convert android UI xml to code

cingusoft

New Member
So, I'm trying to make a dynamic UI, and i want to add a seperator to it. unfortunately, i could only find out how do one in XML. is it possible to turn this\[code\]<ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/seperator" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingBottom="2dp" android:paddingLeft="5dp" android:paddingRight="5dp" android:paddingTop="2dp" android:scaleType="fitXY" android:src="http://stackoverflow.com/questions/11143236/@android:drawable/divider_horizontal_dark" />\[/code\]into program code?my best attempt was\[code\]ImageView seperator=new ImageView(this);seperator.setImageDrawable(drawable.divider_horizontal_dark);\[/code\]
 
Back
Top