My XML:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/signOut"
android:layout_centerInParent="true"
android:layout_marginLeft="10dip"
/>
<TextView
android:id="@+id/gridtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/imageMenu"
android:layout_marginLeft="10dip"
android:layout_marginTop="10dip"
android:layout_centerHorizontal="true"
android:text="TextView"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000" />
</RelativeLayout>
I’m able to set text exactly below the image in this grid-layout but I also want it to wrap the text to next line if the it is too big. For example, I have an image of “bloodbank” and text is “Nearest Blood-Banks”. I want it to be contained within the width of the image. How to do it?
try with this one.