1
我创建了自定义视图以及相应的自定义属性。例如android在自定义视图上并排定义属性和自定义属性
<declare-styleable name="stripbar">
<attr name="flowDirection" format="string"/>
</declare-styleable>
和
public Stripbar(Context context, AttributeSet attrs)
{
super(context, attrs);
TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.stripbar);
CharSequence flowDirection = ta.getString(R.styleable.stripbar_flowDirection);
String text = attrs.getAttributeValue("android", "text");
}
和
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ns="http://schemas.android.com/apk/res/com.ns">
<com.ns.Stripbar
android:id="@+id/aaa"
ns:flowDirection="RightToLeft"
android:text=”yoo hoo”/>
我收到属性文字空值。我也知道this,不知道如何解决这个问题。
为了澄清,我需要获得我的自定义属性值以及android预定义的属性值并排?
任何帮助?