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
<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="@android:drawable/divider_horizontal_dark" />
into program code?
my best attempt was
ImageView seperator=new ImageView(this);
seperator.setImageDrawable(drawable.divider_horizontal_dark);