怎样解决错误:error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value
2015-04-13 16:57
716 查看
错误分析,要是这个控件左边添加控件,必须要在这个控件声明时候。
<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之前。
<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之前。
相关文章推荐
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/ history_child_
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_friend
- Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/p
- Error:(26, 34) No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/b
- No resource found that matches the given name (at 'layout_constraintRight_toLeftOf' w
- No sources that matches the given name (at 'layout_toLeftOf' with value '@id/
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_frien
- Error: No resource found that matches the given name (at 'theme' with value '@style/ AppTheme').
- Android错误之--Error retrieving parent for item: No resource found that matches the given name 'Theme.A
- 升级android sdk到5.0,创建项目错误:No resource found that matches the given name 'android:Widget...... '解决方法
- AndroidManifest.xml:10: error: Error: No resource found that matches the given name (at 'icon' with
- 关于error: Error: No resource found that matches the given name (at 'text' with value '@string/hello')
- 解决error: Error retrieving parent for item: No resource found that matches the given name 'AppCompat'
- error: Error: No resource found that matches the given name (at 'text' with value '@string/
- Android studio b Error: No resource found that matches the given name (at 'src' with value '@dra...
- 解决error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppC
- error: Error: No resource found that matches the given name: attr 'actionBarTabStyle'.
- No resource found that matches the given name 'android:Theme.Holo.Light'解决方法
- Error retrieving parent for item: No resource found that matches the given name 'android:TextAppeara
- error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCom