Я новый андроид развития. Ниже я прикрепляю свой файл макета.
В моем расположении у меня есть один ListView
и один EditText
с ImageButton
. Когда я вставляю задачу в EditText
и нажимаю ImageButton
, эта задача будет добавлена в ListView
одна за другой.
Моя проблема предположит, что я добавить более 4 задачи означает, что EditText
с ImageButton
зрения не виден, потому что элементы списка, которые принимают place.I добавить свой снимок экрана выше их просьбе дать решение спасибо ...
`**Layout:**
<?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" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="3" >
<Button
android:id="@+id/todaytaskbtnid"
style="?android:attr/buttonStyleSmall"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_weight="1"
android:background="@drawable/buttonselector"
android:text="TODAY" />
<Button
android:id="@+id/tomorrowtaskbtnid"
style="?android:attr/buttonStyleSmall"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/buttonselector"
android:text="TOMORROW" />
<Button
android:id="@+id/futuretaskbtnid"
style="?android:attr/buttonStyleSmall"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/buttonselector"
android:text="FUTURE" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ListView
android:id="@+id/frontpagetasklistid"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<RelativeLayout
android:id="@+id/relativelayoutid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom" >
<EditText
android:id="@+id/edittextidAddTodayTask"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/edittextselector"
android:hint="Add Today Task" />
<ImageButton
android:id="@+id/imagebuttonidAddTodayTask"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:src="@drawable/addtask" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
Вы не должны жёстко высоту ListView вместо заставить его используйте оставшееся пространство на экране. – user818455
Будет работать в RelativeLayout (который может быть использован, конечно), но как это сделать в линейной компоновке? –