I would like to create a view in android that componsed of an ImageView
and a TextView
upon this ImageView
. But the Custom views that we can create in Android contain attributes that can only be of certain types, as specified in this post : Defining custom attrs So I can't define a custom view with an ImageView
attribute and a TextView
attribute.
I don't want to define it this way neither :
<FrameLayout android:id="@+id/frame_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/card_11"
android:layout_width="@dimen/card_width"
android:layout_height="@dimen/card_height"
android:src="@drawable/carte_vierge_bleue"
android:scaleType="fitXY"
android:clickable="true"
android:visibility="visible"
android:onClick="onCardClicked"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="1234 5678 1234 5678"
android:layout_gravity="center"/>
</FrameLayout>
Because I would like to add other images on the first ImageView
after that so I would like to have a custom view that I can modify however I want, and add on it as many ImageView
s as I want, and this way of doing would make the layout file very long...
Any idea ?