我需要幫助添加機器人:layout_below現在將成功地我的應用程序崩潰後當過我開始看到的結果,我希望你能幫助我,這是我的代碼我的應用程序崩潰:layout_below
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="?android:attr/listPreferredItemHeight"
android:padding="6dip" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/secondLine"
android:layout_alignParentLeft="true"
android:gravity="center_vertical"
android:text="@string/state1"
android:textSize="16sp" />
<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="26dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@id/textView1"
android:ellipsize="marquee"
android:singleLine="true"
android:text="@string/sayer1"
android:textSize="12sp" />
</RelativeLayout>
這我的logcat
12-18 13:57:18.581: D/AndroidRuntime(2237): Shutting down VM
12-18 13:57:18.581: W/dalvikvm(2237): threadid=1: thread exiting with uncaught exception (group=0x411e62a0)
12-18 13:57:18.581: E/AndroidRuntime(2237): FATAL EXCEPTION: main
12-18 13:57:18.581: E/AndroidRuntime(2237): java.lang.IllegalStateException: Circular dependencies cannot exist in RelativeLayout
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.RelativeLayout$DependencyGraph.getSortedViews(RelativeLayout.java:1321)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.RelativeLayout.sortChildren(RelativeLayout.java:316)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:337)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.View.measure(View.java:15481)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5107)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.View.measure(View.java:15481)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.LinearLayout.measureVertical(LinearLayout.java:833)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.LinearLayout.onMeasure(LinearLayout.java:574)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.View.measure(View.java:15481)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5107)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
12-18 13:57:18.581: E/AndroidRuntime(2237): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2361)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.View.measure(View.java:15481)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1999)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1238)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1413)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1131)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4611)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.Choreographer.doFrame(Choreographer.java:525)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.os.Handler.handleCallback(Handler.java:615)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.os.Handler.dispatchMessage(Handler.java:92)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.os.Looper.loop(Looper.java:137)
12-18 13:57:18.581: E/AndroidRuntime(2237): at android.app.ActivityThread.main(ActivityThread.java:4898)
12-18 13:57:18.581: E/AndroidRuntime(2237): at java.lang.reflect.Method.invokeNative(Native Method)
12-18 13:57:18.581: E/AndroidRuntime(2237): at java.lang.reflect.Method.invoke(Method.java:511)
12-18 13:57:18.581: E/AndroidRuntime(2237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1008)
12-18 13:57:18.581: E/AndroidRuntime(2237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
12-18 13:57:18.581: E/AndroidRuntime(2237): at dalvik.system.NativeStart.main(Native Method)
您正在創建循環依賴關係。 你如何表現這一點。 – SilentKiller