android - How do I properly set text onto a dynamically loaded image? -
i have custom array adapter each item consists of 2 textviews on imageview(smartimageview 3rd party imageview renders remote images url):
<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <com.loopj.android.image.smartimageview android:id="@+id/backgroundimage" android:layout_width="match_parent" android:layout_height="match_parent"/> <relativelayout android:id="@+id/text" android:layout_width="match_parent" android:layout_height="match_parent"> <textview android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_margintop="10dp" android:text="data model title" android:textsize="30sp" /> <textview android:id="@+id/details" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/title" android:layout_marginbottom="10dp" android:layout_marginleft="10dp" android:layout_margintop="10dp" android:text="data model details" android:textsize="15sp" /> </relativelayout> </framelayout>
i see image top , bottom margin , no text:
1) relativelayout text should go on image since 2nd kid of framelayout
2) why there margin above , below image? said imageview's dimensions match parent, , didnt specify top or bottom margins it
it should , does. text didn't show different reason. i added android:scaletype="centercrop" filled row completely.
android framelayout
No comments:
Post a Comment