今天继续学习郭少的<<第一行代码>>,读到3.3.2相对布局这一章(P102页),根据书上的实例,运行以后在控制台显示了,
Information:Gradle tasks [:app:assembleDebug]
C:\Users\Administrator\AndroidStudioProjects\UILayoutTest\app\src\main\res\layout\activity_main.xml
Error:(10, 31) No resource found that matches the given name (at 'layout_above' with value '@id/button3').
Error:(11, 34) No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/button3').
Error:(17, 31) No resource found that matches the given name (at 'layout_above' with value '@id/button3').
Error:(18, 35) No resource found that matches the given name (at 'layout_toRightOf' with value '@id/button3').
好你是说没有找到与‘@id/button3‘匹配的名字的资源,怎么回事呢,仔细看了一下activity_main.xml,发现了问题
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/button3"
android:layout_toLeftOf="@id/button3"
android:text="Button 1" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/button3"
android:layout_toRightOf="@id/button3"
android:text="Button 2" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="Button 3" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/button3"
android:layout_toLeftOf="@id/button3"
android:text="Button 4" />
<Button
android:id="@+id/button5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/button3"
android:layout_toRightOf="@id/button3"
android:text="Button 5" />
最后读到第103页,上面清楚的写到。注意,当一个控件去引用另一个控件的id时,该控件一定要定义在引用控件的后面,不然会出现找不到id的情况。将button3写到中间了,将button3的位置放到button1上面就行了,期待大家不要犯同样的错误!
相关推荐
No resource found that matches the given name..... ....... 使用apktool-2.0.3也可以回编译,但是比如微信回编译后会增加到110M左右,很不友好。 而使用apktool-2.3.2和原包大小一样,65M左右。 基于apktool
2 微信官方教程:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1419316505&token=&lang=zh_CN 3.pc页面显示 4. 通过官方提供的文档,我们可以看出一共分...
rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...
./configs/media_profiles.xml: not perform any checks at all. 不用修改 ./vendorsetup.sh:add_lunch_combo octopus_perf-eng ./vendorsetup.sh:add_lunch_combo octopus_perf-user 直接用cb5801搜索替换perf...
./configs/media_profiles.xml: not perform any checks at all. 不用修改 ./vendorsetup.sh:add_lunch_combo octopus_perf-eng ./vendorsetup.sh:add_lunch_combo octopus_perf-user 直接用cb5801搜索替换perf...
onNewSelection@resource://devtools/client/inspector/inspector.js:1324:5 emit@resource://devtools/shared/event-emitter.js:178:15 emit@resource://devtools/shared/event-emitter.js:255:5 setNodeFront@...
KingTV 本App 采用 MVP RXJava ...Name: Jenly Email: jenly1314@gmail.com / jenly1314@vip.qq.com CSDN: http://blog.csdn.net/jenly121 Github: https://github.com/jenly1314 微信公众号: 加入QQ群: 2086
rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. ...
final Button btn_location = (Button) findViewById(R.id.btn_location); btn_location.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-...
\\__.-"-._____ \\__.-"-...npm install resource-race 使用 import race from 'resource-race' ; const urls = [ 'https://cdn1.com/img.png' , 'https://cdn2.com/img.png' , 'https://cdn3.com/img.png' ] ; race
android tools 29.02
lrwxrwxrwx root root 1970-01-02 10:18 driver -> ../../../../../bus/i2c/drivers/pcf8563 -r--r--r-- root root 4096 1970-01-02 10:18 modalias -r--r--r-- root root 4096 1970-01-02 10:18 name drwxr-xr-x ...
- error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon'). - Should explicitly set android:allowBackup to true or false (it's true by default, and ...
主要给大家介绍了关于微信小程序npm引入vant-weapp的踩坑记录,文中通过示例代码介绍的非常详细,对大家学习或者使用微信小程序具有一定的参考学习价值,需要的朋友们下面来一起学习学习吧
The curious ones might notice that RunFromToken is attached as a resource. Have added the original source of RunFromToken as the exe's must be present in current directory when building RunAsTi. ...
The RhinoPython community is very active and offers a wonderful resource for posting questions/answers and fi nding help on just about anything!: http://python.rhino3d.com/forums/ General References ...
错误如下: LookupError: ********************************************************************** Resource 'taggers/averaged_... obtain the resource: >>> nltk.download() Searched in: - 'C:\\Users\\Dr
how to implement some of the power and resource management principles that have been discussed in the document S60 Platform: Effective Power and Resource Management (available at ...
Note that with the URLs for #6 and #7, you should include a list of five things that make the Web pages well-designed and poorly-designed, respectively. Description - Part B Pick one of the topics ...
Ensure that the machine can be connected and that it runs the rstat daemon (use rpcinfo utility for this verification). Detailed error: RPC: Failed to create RPC client. RPC-TCP: Failed to ...