大众信息网

安卓开发You must supply a layout_width attribute. Couldn't resolve resource @string/text1

答案:2  mip版
解决时间 2021-02-23 00:46
  • 提问者网友:負袮、叕哬妨
  • 2021-02-22 08:20
我写的程序:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/screen"
android:layout_width="fill_content"
android:layout_height="fill_parent"
android:orientation = "vertical">
<TextView android:id="@+id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="24sp"
android:text="@string/text1"/>
<Button android:id="@+id/button1"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="24sp"
android:text="@string/red"/>
<TextView android:id="@+id/button2"
android:layout_width="80sp"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="24sp"
android:text="@string/green"/>
</LinearLayout>
出的错:
You must supply a layout_width attribute.
Couldn't resolve resource @string/text1
Couldn't resolve resource @string/red
Couldn't resolve resource @string/green
请高手帮忙解决哦!!!
最佳答案
  • 二级知识专家网友:清欢话寂寥
  • 2021-02-22 09:58
你好!

你太牛了,请问你想用这个才程序实现什么功能呢

希望对你有所帮助,望采纳。
全部回答
  • 1楼网友:往事叫我剪短发
  • 2021-02-22 10:31
+qq远程控制帮你解决,qq:1422658635
我要举报
如以上问答内容为低俗/色情/暴力/不良/侵权的信息,可以点下面链接进行举报,我们会做出相应处理,感谢你的支持!
点此我要举报以上问答信息
推荐资讯