【发布时间】:2011-02-02 07:13:23
【问题描述】:
我有一个 android 应用程序,它由 FrameLayout 的主布局组成,在 RelativeLayout 中设置了两个视图。 (请参阅下面的布局 XML 文件)。 问题在于第二个视图 (view2) 的屏幕方向(视图变为黑色并且应用程序被冻结)。
我尝试使用该选项没有成功 机器人:方向=“水平” 在布局土地资源中。
请指教。
谢谢。 橡树人
main.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<include android:id="@+id/notelist" layout="@layout/view1" />
<include android:id="@+id/notelist" layout="@layout/view2" />
</FrameLayout>
view1.xml
<RelativeLayout android:id="@+id/Layout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:id="@+id/image01"
android:layout_height="wrap_content"
>
</ImageView>
</RelativeLayout>
view2.xml
<RelativeLayout android:id="@+id/Layout02"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:id="@+id/image02"
android:layout_height="wrap_content"
>
</ImageView>
</RelativeLayout>
【问题讨论】:
标签: android orientation android-relativelayout android-framelayout