【发布时间】:2017-07-17 15:37:09
【问题描述】:
我已经在 String.xml 中指定了字符串值
<string name="complaint_fragment_type_label">Type</string>
在布局文件中作为
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:maxLines="1"
android:text="@string/complaint_fragment_type_label"
android:textSize="17sp"
android:textStyle="bold" />
但我在 TextView 中获取字符串“Type”时出错。在 textview 中获取字符串的解决方案可能是什么?
【问题讨论】:
-
but i am having errors in getting the string "Type" in the TextView.是什么错误?!! -
您的代码没有错误..您遇到了什么错误
-
显示日志猫
-
你在真机上测试过吗?看来您在 xml 文件中看到了
-
我已经测试了你的代码,它工作正常。请发布你的错误日志
标签: android layout textview string.xml