A.A
A.A

Reputation: 1148

This RelativeLayout layout or its LinearLayout parent is possibly useless?

I have below xml that in RelativeLayout get me this :

WARNING :

This RelativeLayout layout or its LinearLayout parent is possibly useless

XML FILE :

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
    android:id="@+id/heading"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <RelativeLayout <--- This RelativeLayout layout or its LinearLayout parent is possibly useless -->
        android:id="@+id/dings"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" 
        android:layout_margin="8dip">

        <ProgressBar
            android:id="@+id/prgDownload"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="fill_parent"
            android:layout_height="32dip"/>

        <TextView
            android:id="@+id/txtDownload"
            android:layout_width="fill_parent"
            android:layout_height="32dip"
            android:gravity="center"
            android:text="..."
            android:textColor="#afafaf"
            android:textSize="18dip"
            android:textStyle="bold" />
    </RelativeLayout>

</LinearLayout>

Notice :My LinearLayout is vertical but when i use it,it convert to horizontal in Graphical Layout .

Upvotes: 0

Views: 2672

Answers (2)

user3454279
user3454279

Reputation: 5

This means you are having RelativeLayout wrapped in LinearLayout But Actually your Relative layout is required you just need to remove Linearlayout.

Upvotes: 0

Jason John
Jason John

Reputation: 936

The Linear Layout contains a relative layout, which contains the rest of your views. Just remove the linear layout tags and you'll be good to go!

Upvotes: 2

Related Questions