我有一个LinearLayout
与ViewFlipper
(动态添加图像)和更多的东西里面。当走景观时,我只想让全屏显示ViewFlipper
。那可能吗?我知道我可以使用onConfigurationChanged检测方向更改,但我不知道是否可以动态地制作全屏视图。当改变方向为风景时使FlipperView全屏
有人可以帮忙吗?
感谢
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item_detail" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#FFFFFF">
<RelativeLayout android:id="@+id/top_bar"
android:layout_width="fill_parent" android:layout_height="44dp"
android:background="@drawable/nav_bar">
<ImageButton android:id="@+id/btn_map"
android:layout_width="34dp" android:layout_height="34dp"
android:src="@drawable/btn_map"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp" />
<TextView android:id="@+id/top_bar_title"
android:layout_width="200dp" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:gravity="center"
android:textSize="16sp" android:textColor="#FFFFFF"
android:textStyle="bold" android:layout_marginLeft="60dp" />
</RelativeLayout>
<ScrollView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_below="@id/top_bar">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="200dp">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="200dp">
<ViewFlipper android:id="@+id/itemdetail_gallery"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</ViewFlipper>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
使用layout-land中的同名布局来重新创建活动。去lanscape时,我只想旋转ViewFlipper并使其全屏。 – jul 2011-05-31 07:48:44
无论您是否创建layout-land目录,您的活动始终都会重新创建,除非您明确修改清单文件以避免它,您是否这样做?)。 – Cristian 2011-05-31 11:45:10