0
我试图在线性布局内生成表格布局,而我放入第二个布局内的任何内容都没有显示出来。我试图做这样的事情:线性布局内的内容未显示
https://www.dropbox.com/s/gnk3plt0ci3d2u8/tabla.png?dl=0
我试图在线性布局内生成表格布局,而我放入第二个布局内的任何内容都没有显示出来。我试图做这样的事情:线性布局内的内容未显示
https://www.dropbox.com/s/gnk3plt0ci3d2u8/tabla.png?dl=0
已设置为内用线性布局的宽度和高度属性会导致为您解决问题。其实值显示,但不可见你。
我建议你使用weightsem属性来控制布局的宽度。
试试下面的代码,我希望它能为你工作。
代码..
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".LinearLayout" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="100" >
<ImageView
android:id="@+id/profile_picture"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="20"
android:padding="15dp"
android:src="@drawable/ic_launcher" />
<TableLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="80"
android:padding="20dp" >
<TableRow>
<TextView android:text="Emma Watson" />
</TableRow>
<TableRow>
<TextView android:text="Calorias" />
</TableRow>
<TableRow>
<TextView android:text="CO2" />
</TableRow>
<TableRow>
<TextView android:text="Distancia" />
</TableRow>
</TableLayout>
</LinearLayout>
</LinearLayout>
谢谢!它的工作现在 – 2014-10-07 03:57:26