[問題] 新手請問RelativeLayout??

看板AndroidDev作者 (千里之外)時間12年前 (2011/11/17 00:28), 編輯推噓3(302)
留言5則, 4人參與, 最新討論串1/1
最近買了一本書"Android SDK實戰演練" 在練習到RelativeLayout這個部份時...有點問題... 我試打了下面的程式碼在xml檔.. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/contact_entry" android:layout_width="fill_parent" android:layout_height="wrap_parent" android:text="聯絡人" /> </RelativeLayout> 正常會顯示聯絡人的字樣... 但我的畫面都沒有... 如圖 http://ppt.cc/gn~9 請問是哪邊少設定到嗎?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.41.139.117

11/17 01:14, , 1F
將聯絡人上面一行的wrap_parent改成wrap_content
11/17 01:14, 1F

11/17 01:14, , 2F
應該就行了
11/17 01:14, 2F

11/17 07:17, , 3F
檢查 fill_parent 跟 wrap_content。這部份容易打錯字.
11/17 07:17, 3F

11/17 12:43, , 4F
我想法跟1樓依樣~原PO有解決了嗎?
11/17 12:43, 4F

11/17 22:26, , 5F
恭喜樓上各位大大...您答對了!!! 真是眼花了!!
11/17 22:26, 5F
文章代碼(AID): #1Em-Iqsg (AndroidDev)