【发布时间】:2011-07-21 12:38:12
【问题描述】:
我想在第三个父布局中有两个线性布局。我希望第一个线性布局方向是水平的,第二个是垂直的。
我尝试通过以下代码来实现这一点。但是,第二个线性布局没有出现。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF">
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
>
<ImageButton android:id="@+id/ImageButton01"
android:layout_width="80px"
android:layout_height="80px"
android:background="@drawable/projects_badge"
android:layout_margin="10px"/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal"
>
<ImageView android:id="@+id/ImageView01"
android:layout_width="200px"
android:layout_height="81px"
android:src="@drawable/logo"
android:adjustViewBounds="true"
android:layout_marginTop="15px"/>
<TextView android:id="@+id/TextView01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:textColor="#9CC721"/>
</LinearLayout>
</LinearLayout>
我们将不胜感激。
提前致谢。
【问题讨论】: