I'm trying to get the margins from the .xml
file. Currently I'm doing it like so:
mUserDefinedLeftMargin = attrs.getAttributeIntValue("http://schemas.android.com/apk/res/android", "layout_marginLeft", 0);
where attrs
is of type AttributeSet
(it's received in the constructor or my class which extends RelativeLayout
)
The .xml
looks like this:
<ch......MyCustomView
android:id="@+id/update_progress"
android:layout_width="400dp"
android:layout_height="200dp"
android:layout_marginLeft="10dp"
android:layout_alignParentRight="true"
android:visibility="invisible" />
mUserDefinedLeftMargin
is still 0 at the end of the above call. Why ?