av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

Android程序開發(fā)基礎(chǔ)之——頁(yè)面布局

1、gravity

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

gravity 這個(gè)英文單詞是重心的意思,在這里就表示停靠位置的意思。

Android:gravity是對(duì)元素本身說的,元素本身的文本顯示在什么地方靠著換個(gè)屬性設(shè)置,不過不設(shè)置默認(rèn)是在左側(cè)的。

android:layout_gravity是相對(duì)與它的父元素說的,說明元素顯示在父元素的什么位置。

比如說button: android:layout_gravity 表示按鈕在界面上的位置。 android:gravity表示button上的字在button上的位置。

可選值:top、bottom、left、right、center_vertical、fill_vertical、center_horizontal、fill_horizontal、center、fill、clip_vertical。

而且這些屬性是可以多選的,用“|”分開,默認(rèn)這個(gè)的值是:Gravity.LEFT

2、layout_weight

layout_weight 用于給一個(gè)線性布局中的諸多視圖的重要度賦值。

所有的視圖都有一個(gè)layout_weight值,默認(rèn)為零,意思是需要顯示多大的視圖就占據(jù)多大的屏幕空間。若賦一個(gè)高于零的值,則將父視圖中的可用空間分割,分割大小具體取決于每一個(gè)視圖的layout_weight 值以及該值在當(dāng)前屏幕布局的整體 layout_weight值和在其它視圖屏幕布局的layout_weight值中所占的比率而定。

舉個(gè)例子:比如說我們?cè)?水平方向上有一個(gè)文本標(biāo)簽和兩個(gè)文本編輯元素。

該文本標(biāo)簽并無指定layout_weight值,所以它將占據(jù)需要提供的最少空間。如果兩個(gè)文本編輯元素每一個(gè)的layout_weight值都設(shè)置為1,則兩者平分在父視圖布局剩余的寬度(因?yàn)槲覀兟暶鬟@兩者的重要度相等)。如果兩個(gè)文本編輯元素其中***個(gè)的layout_weight值設(shè)置為1,而第二個(gè)的設(shè)置為2,

則剩余空間的三分之二分給***個(gè),三分之一分給第二個(gè)(數(shù)值越小,重要度越高)。

[[73020]]

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="@drawable/bg02"

android:orientation="horizontal" >

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

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="4"

android:orientation="vertical" >

android:id="@+id/txtSpace1"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="" />

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

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="1"

android:orientation="vertical" >

android:id="@+id/txtSpace2"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="" />

android:id="@+id/button1"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

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

android:id="@+id/button2"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

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

android:id="@+id/button3"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

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

android:id="@+id/button4"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

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

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

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:layout_weight="4"

android:orientation="vertical" >

android:id="@+id/txtSpace3"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="" />


網(wǎng)站名稱:Android程序開發(fā)基礎(chǔ)之——頁(yè)面布局
標(biāo)題網(wǎng)址:http://uogjgqi.cn/article/dhiophs.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營(yíng)咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流