[問題] stretchColumns="*" 使用

看板AndroidDev作者 (code)時間12年前 (2013/05/08 23:46), 編輯推噓4(401)
留言5則, 5人參與, 最新討論串1/1
小弟最近在排面板 我想要用 <LinearLayout>將兩個textview使用horizontal方式排列 以一樣比例塞入,我使用了stretchColumns="*",以為就可以達成效果, 但是卻一點都沒有改變,textview還是以內容的文字多寡為size 請問該如何解決,打字可能不清楚,所以貼下code <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="*" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="size" /> <TextView android:id="@+id/show" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/TextView01" android:text="non" /> </LinearLayout> 麻煩各位大大了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.58.187.208

05/09 12:08, , 1F
不知道linear能不能 不過不如用個tablerow嗎?
05/09 12:08, 1F

05/09 14:04, , 2F
還是要下weight吧,這個屬性只是在做填滿而已
05/09 14:04, 2F

05/09 23:09, , 3F
試試 layout_weight ?
05/09 23:09, 3F

05/10 12:01, , 4F
官網有教喔 http://goo.gl/1wo70
05/10 12:01, 4F

05/10 13:36, , 5F
謝謝回答 我試試
05/10 13:36, 5F
文章代碼(AID): #1HYdD0ht (AndroidDev)