简体   繁体   中英

set ImageView above Textview

I just want to do a very simple think :

I want to put an ImageView on full screen with just a simple TextView on his Bottom, not Over but just on his bottom..

I tried some combination but nothing worked fine..

Here is my current basic XML code:

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/imgset"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:src="@drawable/creditview" />

    <RelativeLayout
    android:id="@+id/layoutimgset"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">

    <TextView android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="This spot is for Ad"
        android:textStyle="bold"
        android:textColor="@color/black"
        android:background="@color/white" />

    </RelativeLayout>
</LinearLayout>

This only show the ImageView..

Try to use for your ImageView this:

android:layout_weight="1" 

In this case you don't need RelativeLayout. Or put all to RelativeLayout and use

android:layout_below="@+id/imgset"

for your TextView

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM