Elements in Relative Layout showing differently when the app runs

笑着哭i 提交于 2019-12-06 12:06:26

I get error when trying your ListView (I think that it is individuals.xml), e.g. TextView android:id="@id/android:empty" has an attribute android:layout_below="@+id/button3" but I can't find button3 in your layout.

This may be the layout that you want, individuals.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:srcCompat="@drawable/individuals_img"
    android:src="@drawable/individuals_img"
    android:id="@+id/imageView3"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true"/>

<SearchView
    android:id="@+id/ser1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:queryHint="Search.."
    android:background="@android:color/holo_red_dark"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_toLeftOf="@+id/imageView3"
    android:layout_toStartOf="@+id/imageView3" >
</SearchView>

<TextView android:id="@id/android:empty"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="No data"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/ser1" />

<ListView android:id="@id/android:list"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/ser1" />

 </RelativeLayout>

If this is not what you are looking for, please also show what your layout looks like in Android Studio layout editor. Hope it help :)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!