当这里是我的logcat错误:Android应用程序强制关闭改变纵向到横向
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jc.jcpremiere/com.jc.jcpremiere.activity2}: java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.os.Bundle instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/aboutview. Make sure other views do not use the same id.
我得到这个每当我转我的手机从人像到风景。我的/layout
和/layout-land
的布局只包含一个显示图像的视图,但在纵向上,它可以被捏和放大,并且位于centerInside
之间,在横向上它是fitxy
。
这里是我的肖像
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rellayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.jc.jcpremiere.TouchImageView
android:id="@+id/aboutview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:adjustViewBounds="true"
android:background="@color/White"
android:scaleType="centerInside" />
</RelativeLayout>
而对于我的风景
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativelayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/aboutview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/White"
android:scaleType="fitXY" />
</RelativeLayout>
有没有一种方法,我可以只使用imageview的景观和适合xy和肖像我可以使用touchimageview中心里面? – user3334111 2014-09-11 02:33:35