作者spiderman007 (千里之外)
看板AndroidDev
標題[問題] 新手請問RelativeLayout??
時間Thu Nov 17 00:28:34 2011
最近買了一本書"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
1F:推 solomn:將聯絡人上面一行的wrap_parent改成wrap_content 11/17 01:14
2F:→ solomn:應該就行了 11/17 01:14
3F:推 milochen:檢查 fill_parent 跟 wrap_content。這部份容易打錯字. 11/17 07:17
4F:推 alexcarol:我想法跟1樓依樣~原PO有解決了嗎? 11/17 12:43
5F:→ spiderman007:恭喜樓上各位大大...您答對了!!! 真是眼花了!! 11/17 22:26