fhucho wrote:
I have a custom View, it is created from xml - how can I obtain the
android:layout:width value in the constructor View(Context x,
AttributeSet a) ?
To get at a custom attribute, you would use code like this:
TypedArray a=ctxt.obtainStyledAttributes(attrs,
I did it this way:
String widthString = attrs.getAttributeValue(http://
schemas.android.com/apk/res/android, layout_width);
// now widthString can ba for example 150px, I need to convert it to
int
int s = Integer.parseInt(widthString.substring(0, 3));
On Oct 18, 2:30 pm, Mark Murphy
fhucho wrote:
I did it this way:
String widthString = attrs.getAttributeValue(http://
schemas.android.com/apk/res/android, layout_width);
// now widthString can ba for example 150px, I need to convert it to
int
int s = Integer.parseInt(widthString.substring(0, 3));
I will reiterate my
3 matches
Mail list logo