Android的XML布局常数 [英] Android XML layout constants
问题描述
我在做Android的XML布局文件的一些解析。我想引用Android的XML字符串常量,而不是定义自己的。我可以很容易地找到整型常量,只是没有XML常量。
I'm doing some parsing of Android's XML layout files. I'd like to reference Android's XML string constants rather than define my own. I can find the integer constants easily, just not the XML constants.
在哪里位于这些字符串常量?
Where are these string constants located?
更新:
我在寻找一个字符串值引用像安卓的LinearLayout
,的android:layout_gravity
,的android:layout_width
键,如 match_parent
,中心与这些属性相关的任何值
等。
I'm looking for a literal string referencing values like android:LinearLayout
, android:layout_gravity
, android:layout_width
and any values associated with those attributes such as match_parent
, center
etc.
推荐答案
你的意思是你想从string.xml文件中获取字符串?
did you mean you want to get string from string.xml file?
您可以用得到它。
String get = this.getResources().getString(R.string.string_name);
这篇关于Android的XML布局常数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!