动态弹出的EditText怎样紧挨着输入法上方?

十三邵 2015-09-23 01:34:12

并且想按返回键的时候输入法和EditText一起消失,但是现在有输入法的话,返回键的监听不好用,该怎么办?
...全文
251 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
十三邵 2015-09-23
  • 打赏
  • 举报
回复
引用 3 楼 gao_chun 的回复:
简单粗暴有效果,十分感谢大神指点!!!
gao_chun 2015-09-23
  • 打赏
  • 举报
回复
gao_chun 2015-09-23
  • 打赏
  • 举报
回复
这是布局: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_message" android:layout_width="match_parent" android:layout_height="@dimen/dimen_85_dip" android:layout_alignParentBottom="true" android:background="@color/table_background" android:padding="1px" > <EditText android:id="@+id/edit_content" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:background="@color/white" android:hint="您想说 ..." android:padding="5dp" android:singleLine="true" /> <Button android:id="@+id/button_send" style="@style/text_16" android:layout_width="90dp" android:layout_height="match_parent" android:layout_marginLeft="1px" android:background="@drawable/row_selector" android:onClick="onClick" android:padding="5dp" android:text="发送" android:textColor="@color/main_color" /> </LinearLayout> 将其嵌入另一个布局的底部: <!-- 输入评论内容 --> <include layout="@layout/layout_comment" />
gao_chun 2015-09-23
  • 打赏
  • 举报
回复

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧