[英]How Can I Access Platform Resources (android.R.layout) from XML Layout?
Can I create a TextView
based on android.R.layout.simple_list_item_1 in my XML layout and specify only extra attributes like 我可以在我的XML布局中基于android.R.layout.simple_list_item_1创建
TextView
并仅指定诸如
<TextView based on android.R.layout.simple_list_item_1
android:text="Some text"/>
Thank you in advance. 先感谢您。
If your question is about how you can access platform resources in XML files, I believe this is what you want : 如果您的问题是关于如何访问XML文件中的平台资源的,我相信这就是您想要的:
<include layout="@android:layout/simple_list_item_1" />
You can then customize this item by adding attributes. 然后,您可以通过添加属性来自定义此项目。
I don't know what you mean clearly you can set your extra attributes like below ? 我不明白您的意思是什么,您可以像下面这样设置额外的属性吗?
<TextView based on android.R.layout.simple_list_item_1
android:text="@string/name"/>
and then in your code: 然后在您的代码中:
String name = getResoures.getStringResoures(R.string.name);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.