怎样解决错误:error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value

来源:互联网 发布:宝信软件可转债 编辑:程序博客网 时间:2024/06/04 19:50

错误分析,要是这个控件左边添加控件,必须要在这个控件声明时候。

<RelativeLayout 

<TextView

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_toLeftOf="@id/MoringDiary_interpersonal_next"
            android:text="下一个"
            android:textColor="#ffffff"
            android:textSize="14dip" />


        <Button
            android:id="@+id/MoringDiary_interpersonal_next"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="3dp"
            android:background="@drawable/ic_launcher" />

    </RelativeLayout>

所以应该改为Button应该写在TextView之前。

1 0