大家好,又见面了,我是全栈君,今天给大家准备了Idea注册码。

<LinearLayout xmlns:android = "http://schemas.android.com/apk/res/android" android:layout_width= "fill_parent" android:layout_height= "fill_parent" android:background= "#ffffff" android:gravity= "center" android:orientation= "horizontal" android:weightSum= "1" ><!--1.加入android:weightSum属性--> <Button android:layout_width ="0dp"<!--2.将Button的layout_width设为0dp--> android:layout_height ="wrap_content" android:layout_weight ="0.5"<!--3.确保其占用了50%的可用空间--> android:text ="@string/activity_main_click_me" /> </LinearLayout>
Widget’s width + Widget’s weight*Parent’s width/Parent’s weightSum
版权声明:本文博客原创文章。博客,未经同意,不得转载。
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/117494.html原文链接:https://javaforall.net