iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 23
0
IoT

IoT 大亂鬥系列 第 23

LinearLayout - 3

前兩天,我們是做垂直的測試。
那今天我們來試試改成垂直的話。
首先把
android:orientation="vertical"
改成
android:orientation="horizontal"
先按一下run來看看。
https://ithelp.ithome.com.tw/upload/images/20201004/20129280OpDtbKX1Av.jpg
會發現第一個朋友不見了,
因為呢,前面Botton的地方使用了match_parent,將它全部佔滿了,
那他會先偵測到前面的程式碼,所以後面的文字就都不見了,
所以,當我們將 Botton 和 TextView 的
android:layout_width="match_parent"
都改成
android:layout_height="wrap_content"
https://ithelp.ithome.com.tw/upload/images/20201004/20129280zhaY26tP9x.jpg
可以看到,這樣 Botton 和 TextView 的都出現囉


上一篇
LinearLayout - 2
下一篇
LinearLayout - 版面權重
系列文
IoT 大亂鬥29
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言