欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

安卓中l(wèi)inearLayout下android_layout.weight的屬性的詳細介紹

weight屬性,從字面上理解是比重的意思,是和布局里其他部件相比較而言的。

榆陽ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

1:在狀態(tài)設置再orientation為horizontal、寬度設置為fill_parent、比例一個設置為1,一個設置為2的時候,如截圖所示:

安卓中l(wèi)inearLayout下android_layout.weight的屬性的詳細介紹

此時顯示的狀態(tài)是第一個長度和第二個長度的比例是2:1,就是第一個長度要長一些。

2:現(xiàn)在修改一下放置的狀態(tài),修改成垂直放置android:orientation="vertical",其他條件不變,

如下所示:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

   xmlns:tools="http://schemas.android.com/tools"

   android:layout_width="match_parent"

   android:layout_height="match_parent"

   android:orientation="vertical"

   tools:context="com.Test0101_21.MainActivity$PlaceholderFragment" >

   <Button

       android:layout_width="fill_parent"

       android:layout_height="wrap_content"

       android:layout_weight="1"

       android:text="@string/hello_world" />

 <Button

       android:layout_width="fill_parent"

       android:layout_height="wrap_content"

       android:layout_weight="2"

       android:text="@string/hello" />

</LinearLayout>

其運行結果是部件以上下進行排列,第二個部件和第一個部件寬度的比例是2:1,

結論:在水平方向上,比重越大,所顯示的面積就越大,比重越小,顯示的面積就越小。

     在垂直方向上,比重越大,起顯示的面積就越小,比重越小,起顯示的面積就越大。

     在水平方向上和垂直方向上其作用是相反的。

網(wǎng)頁題目:安卓中l(wèi)inearLayout下android_layout.weight的屬性的詳細介紹
文章分享:http://chinadenli.net/article28/giddjp.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站維護、面包屑導航、定制網(wǎng)站、品牌網(wǎng)站設計、全網(wǎng)營銷推廣、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都app開發(fā)公司