解决异常Circular dependencies cannot exist in RelativeLayout
来源:互联网 发布:clean my mac 怎么样 编辑:程序博客网 时间:2024/05/01 07:37
今天碰到这个error:E/AndroidRuntime( 4657): Uncaught handler: thread main exiting due to uncaught e
xception
E/AndroidRuntime( 4657): java.lang.IllegalStateException: Circular dependencies
cannot exist in RelativeLayout
有点郁闷,我用的是skd1.5,在1.5的机器上(HTC G3)已经测试过了,没有问题的,但放在华为c8500(2.1update)上就报上面的错了,怎么回事呢?
根据提示判断应该是布局的原因,于是找到RelativeLayout的布局,找出最可疑的那个,注释后,不报错了。好就是他的原因,挨个看里面的元素,看属性,没错啊,后来发现,
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white" android:layout_toLeftOf="@+id/homeBtn"
android:layout_marginRight="2px"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" android:layout_marginRight="10px">
</ImageButton>
</RelativeLayout>
后来改成:
<RelativeLayout android:layout_width="wrap_content" android:layout_marginRight="10px"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_marginLeft="2px" android:layout_marginTop="2px"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" >
</ImageButton>
</RelativeLayout>
能看到区别吗?对就是在titleName中去掉了相对homeBtn的位置信息。再看看报错提示,人家说我在RelativeLayout中存在循环的相关,就是说的这个了。
不过1.5版本的不报错,这就是后续版本的改进吗?
xception
E/AndroidRuntime( 4657): java.lang.IllegalStateException: Circular dependencies
cannot exist in RelativeLayout
有点郁闷,我用的是skd1.5,在1.5的机器上(HTC G3)已经测试过了,没有问题的,但放在华为c8500(2.1update)上就报上面的错了,怎么回事呢?
根据提示判断应该是布局的原因,于是找到RelativeLayout的布局,找出最可疑的那个,注释后,不报错了。好就是他的原因,挨个看里面的元素,看属性,没错啊,后来发现,
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white" android:layout_toLeftOf="@+id/homeBtn"
android:layout_marginRight="2px"
android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" android:layout_marginRight="10px">
</ImageButton>
</RelativeLayout>
后来改成:
<RelativeLayout android:layout_width="wrap_content" android:layout_marginRight="10px"
android:layout_height="wrap_content" android:layout_alignParentRight="true">
<TextView android:id="@+id/titleName" android:text="首页"
android:textColor="@color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></TextView>
<ImageButton android:id="@+id/homeBtn"
android:layout_marginLeft="2px" android:layout_marginTop="2px"
android:layout_toRightOf="@+id/titleName" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:src="@drawable/main"
android:background="@null" >
</ImageButton>
</RelativeLayout>
能看到区别吗?对就是在titleName中去掉了相对homeBtn的位置信息。再看看报错提示,人家说我在RelativeLayout中存在循环的相关,就是说的这个了。
不过1.5版本的不报错,这就是后续版本的改进吗?
0 0
- 解决异常Circular dependencies cannot exist in RelativeLayout
- Circular dependencies cannot exist in RelativeLayout错误解决
- android java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- 问题解决java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- android报错Circular dependencies cannot exist in RelativeLayout
- 开发问题及解决--java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- 【android已解决】java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
- Android小知识——java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout的错误
- Android开发——布局Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout
- 错误Exception raised during rendering: Circular dependencies cannot exist in RelativeLayout
- Maven Ban Circular Dependencies
- 解决错误 Some projects cannot be imported because they already exist in the workspace
- 错误解决:Some projects cannot be imported because they already exist in the workspace
- 解决错误 Some projects cannot be imported because they already exist in the workspace
- 解决:Some projects cannot be imported because they already exist in the workspace
- 解决:Some projects cannot be imported because they already exist in the workspace
- 解决:Some projects cannot be imported because they already exist in the workspace
- CANNOT LINK EXECUTABLE DEPENDENCIES: cannot locate symbol解决
- maven依赖servlet-api和jsp-api的问题
- 驱动层注册表操作
- 通过Python调用OpenStack 的RESTful API
- ViewPager+Fragment取消预加载(延迟加载)
- 【R语言】apply函数族
- 解决异常Circular dependencies cannot exist in RelativeLayout
- storm初识印象
- 分部署云存储系统Ceph架构剖析
- weka连接mysql数据库
- C# Socket多线程编程(一)
- 用ViewPager布局,但是又不想预加载的问题
- Google 新推出Background sync API
- spring数据源的几种配置
- 某理财APP多开器的思路(二)