score:77

Accepted answer

please check the below code

<?xml version="1.0" encoding="utf-8"?>
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/ic_launcher" >

<tablelayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

<linearlayout
    android:id="@+id/linearlayout_dist"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/linearlayout_acc"
    android:layout_centerhorizontal="true"
    android:layout_marginbottom="10dp" >

    <textview
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="first" />

    <textview
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="second" />
   </linearlayout>

   <linearlayout
    android:id="@+id/linearlayout_acc"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_above="@+id/progressbar_statusscreen"
    android:layout_centerhorizontal="true" >

    <textview
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="third" />

    <textview
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="fourth" />
   </linearlayout>

   <progressbar
    android:id="@+id/progressbar_statusscreen"
    style="?android:attr/progressbarstylehorizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignparentbottom="true"
    android:layout_margin="16dp" />

 </relativelayout>

also check the following link. it says that android:layout_below="@id/mytextview" won't recognise an element with id "mytextview" if it is written after the element you're using it in.

score:2

 <linearlayout
        android:id="@+id/linearlayout_dist"
        android:layout_above="@+id/linearlayout_acc" <--- here might be a problem you forgot + sign
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerhorizontal="true"
        android:layout_marginbottom="10dp" >

score:15

change every id @id to @+id, no matter when it's defining or referencing an id. with this, you won't get

android xml error: “no resource found that matches the given name” with relativelayout (@id/linearlayout_acc, @id/progressbar_statusscreen).

score:85

change

@id/linearlayout_acc

to

@+id/linearlayout_acc

Related Query

More Query from same tag