проблемы проектирования с представлением переработчика - PullRequest
0 голосов
/ 15 мая 2019

У меня есть строка поиска, где я ищу имя учителя. Но результаты поиска не могут быть просмотрены по мне.Я хотел, если у меня есть два результата поиска, тогда результаты поиска должны отображаться с соответствующими местами, то есть традиционными, как и у любого другого приложения.

Но мои результаты поиска занимают все два места поиска, и я не могу их отредактировать enter image description here

фрагмент.xml

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:background="@drawable/bkg3"
    android:layout_height="match_parent">

    <EditText
        android:id="@+id/search_edittext"
        android:layout_width="232dp"
        android:layout_height="41dp"
        android:layout_marginLeft="40dp"
        android:layout_marginRight="40dp"
        android:background="@color/common_google_signin_btn_text_dark_default"
        android:fontFamily="sans-serif"

        android:hint="Enter Teacher's Name"
        android:textColorHint="@color/common_google_signin_btn_text_dark_focused"
        android:textSize="18dp" />


    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="8dp"></android.support.v7.widget.RecyclerView>

    <EditText
        android:id="@+id/ET1"
        android:layout_width="177dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="90dp"
        android:layout_marginTop="25dp"
        android:layout_marginRight="150dp"
        android:hint="Enter Roll number"
        android:inputType="number"
        android:textColorHint="@color/common_google_signin_btn_text_dark_default"
        android:textSize="14dp" />


    <EditText
        android:id="@+id/ET2"
        android:layout_width="177dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="90dp"
        android:layout_marginRight="150dp"
        android:hint="Enter Roll number"
        android:inputType="number"
        android:textColorHint="@color/common_google_signin_btn_text_dark_default"
        android:textSize="14dp" />

    <EditText
        android:id="@+id/ET3"
        android:layout_width="175dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="90dp"
        android:layout_marginRight="150dp"
        android:hint="Enter Roll number"
        android:inputType="number"
        android:textColorHint="@color/common_google_signin_btn_text_dark_default"
        android:textSize="14dp" />

    <EditText
        android:id="@+id/ET5"
        android:layout_width="175dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="90dp"
        android:layout_marginRight="150dp"
        android:hint="Enter Roll number"
        android:inputType="number"
        android:textColorHint="@color/common_google_signin_btn_text_dark_default"
        android:textSize="14dp" />

    <EditText
        android:id="@+id/ET4"
        android:layout_width="173dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="90dp"
        android:layout_marginRight="150dp"
        android:hint="Enter Roll number"
        android:inputType="number"
        android:textColorHint="@color/common_google_signin_btn_text_dark_default"
        android:textSize="14dp" />

    <Button
        android:id="@+id/submit"
        android:layout_width="138dp"
        android:layout_height="38dp"
        android:layout_marginLeft="90dp"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="20dp"
        android:background="@color/common_google_signin_btn_text_dark_default"
        android:text="Submit" />


</LinearLayout>

search_list.xml

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

    <TextView
        android:id="@+id/full_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:padding="8dp"
        android:text="name "
        android:textColor="@color/common_google_signin_btn_text_light_pressed"
        android:textSize="14sp" />

</LinearLayout>

1 Ответ

0 голосов
/ 15 мая 2019

проверьте ваш XML-файл recyclerView item и измените его высоту в wrap_content следующим образом: -

    <?xml version="1.0" encoding="utf-8"?>
        <android.support.v7.widget.CardView 
    xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:app="http://schemas.android.com/apk/res-auto"
            xmlns:tools="http://schemas.android.com/tools"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="6dp">

            <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/full_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:padding="8dp"
        android:text="name "
        android:textColor="@color/common_google_signin_btn_text_light_pressed"
        android:textSize="14sp" />

</LinearLayout>

        </android.support.v7.widget.CardView>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...