android中關(guān)于margin的一些注意點
系統(tǒng)
1874 0
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_width="wrap_content"
android:text="添加模板"></TextView>
<Spinner android:layout_height="wrap_content" android:id="@+id/sp_template_style"
android:layout_margin="5dip" android:cacheColorHint="@color/blank"
android:layout_width="match_parent"></Spinner>
<EditText android:id="@+id/et_template_add"
android:layout_width="match_parent" android:layout_height="fill_parent"
android:layout_marginLeft="5dip" android:layout_marginRight="5dip"
android:layout_marginTop="5dip" android:layout_marginBottom="30dip" />
</LinearLayout>
?
? ? xml中使用
android:layout_marginBottom="30dip"這個標(biāo)簽,需要注意的是,
別忘了添加:
android:layout_height="fill_parent" ,可以理解為只有當(dāng)容器里面的內(nèi)容進(jìn)入margin的作用域的時候,margin標(biāo)
? ?簽才會起作用。
?
? 效果圖:
?
?
android中關(guān)于margin的一些注意點
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元