【发布时间】:2021-12-31 18:56:06
【问题描述】:
这是我的问题。如果我在 EditText 中有很多文本,我有 EditText 和 ListView。 ListView 不会在顶部滚动,因此结果是 ListView 现在被 editText 占用。
This is the image when there is now text in EditText
This is the image when there is now many texts in EditText
我希望有人理解并帮助我解决另一个问题????????
这是我的代码:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:text="send"
android:id="@+id/button_send"
android:layout_width="60dp"
android:layout_height="52dp"
android:layout_gravity="bottom|right"/>
<EditText
android:id="@+id/mainEditText"
android:background="#EBEBEB"
android:hint="Type your message here..."
android:layout_gravity="bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine|textCapSentences"
android:maxLines="8"
android:minHeight="48dp"
android:minLines="1"
android:paddingLeft="10dp"
android:smoothScrollbar="true"
android:scrollbars="vertical"
android:scrollHorizontally="false"
android:layout_alignParentBottom="true"
android:layout_marginRight="60dp"/>
<RelativeLayout
android:paddingBottom="50dp"
android:layout_gravity="top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ListView
android:layout_alignParentBottom="true"
android:id="@+id/messages_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
android:dividerHeight="0dp"
android:listSelector="@android:color/transparent"
android:stackFromBottom="true"
android:transcriptMode="normal"></ListView>
</RelativeLayout>
【问题讨论】:
-
等等,我看不到我在这里发布的图片....希望你们能看到???????
-
为此添加完整的布局代码。看来您的 editext 和 recyclerview 重叠
-
兄弟看看我的完整布局代码我现在已经编辑了它。我不使用 recycleview 我使用 listView
标签: android listview scroll android-edittext