No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_frien

本文介绍了一种常见的Android布局资源找不到的问题及其解决方案。错误提示通常涉及未找到指定资源,通过修改引用资源的方式可以轻松解决该问题。

错误提示:

error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_friend').



解决方法:

Android:layout_toLeftOf="@id/tx_search_friend"

改为:

android:layout_toLeftOf="@+id/tx_search_friend"

<RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_10" > <TextView android:id="@+id/tv_price" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="燃油单价(升):" android:textSize="15sp" android:textColor="@color/black" /> <EditText android:id="@+id/et_price" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入" android:layout_marginLeft="@dimen/dp_10" android:layout_toRightOf="@id/tv_price" android:background="@android:color/transparent" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="元" android:textColor="@color/black" android:textSize="15sp" android:layout_alignParentRight="true" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_10" > <TextView android:id="@+id/tv_prices" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="加油价格:" android:textSize="15sp" android:textColor="@color/black" /> <EditText android:id="@+id/et_prices" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入" android:layout_marginLeft="@dimen/dp_10" android:layout_toRightOf="@id/tv_prices" android:background="@android:color/transparent" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="元" android:textColor="@color/black" android:textSize="15sp" android:layout_alignParentRight="true" /> </RelativeLayout> <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_10" > <TextView android:id="@+id/tv_mileage" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="行驶公里:" android:textSize="15sp" android:textColor="@color/black" /> <EditText android:id="@+id/et_mileage" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="请输入" android:layout_marginLeft="@dimen/dp_10" android:layout_toRightOf="@id/tv_mileage" android:background="@android:color/transparent" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="公里" android:textColor="@color/black" android:textSize="15sp" android:layout_alignParentRight="true" /> </RelativeLayout>这几个输入框怎么把请输入框对齐
最新发布
11-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值