android – (tablayout)当editText聚焦时,标签会越过键盘

android – (tablayout)当editText聚焦时,标签会越过键盘,第1张

概述我用ViewPager setUp tabLayout,它有5个片段. tabLayout与 android:layout_gravity设置为bottom.第三个片段有editText,当聚焦时,我的标签来自键盘. Tablayout without EditText TabLayout with EditText 主要布局: <?xml version="1.0" encoding="utf- 我用VIEwPager setUp tabLayout,它有5个片段.
tabLayout与 android:layout_gravity设置为bottom.第三个片段有editText,当聚焦时,我的标签来自键盘.

Tablayout without EditText

TabLayout with EditText

主要布局:

<?xml version="1.0" enCoding="utf-8"?>    <androID.support.design.Widget.CoordinatorLayout        xmlns:androID="http://schemas.androID.com/apk/res/androID"        xmlns:app="http://schemas.androID.com/apk/res-auto"        androID:ID="@+ID/coordinatorLayout"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <androID.support.design.Widget.AppbarLayout            androID:ID="@+ID/appbarLayout"            androID:layout_wIDth="match_parent"            androID:layout_height="wrap_content">         <include              androID:ID="@+ID/t"             layout="@layout/toolbar"/>        </androID.support.design.Widget.AppbarLayout>  <androID.support.v4.vIEw.VIEwPager    androID:ID="@+ID/vIEwPager"    androID:layout_wIDth="match_parent"    app:layout_behavior="@string/appbar_scrolling_vIEw_behavior"    androID:layout_height="match_parent"    xmlns:androID="http://schemas.androID.com/apk/res/androID"    xmlns:app="http://schemas.androID.com/apk/res-auto"/>  <androID.support.design.Widget.TabLayout    androID:layout_wIDth="match_parent"    androID:layout_height="wrap_content"    xmlns:app="http://schemas.androID.com/apk/res-auto"    xmlns:tab="http://schemas.androID.com/tools"    androID:layout_gravity="bottom"    app:tabGravity="fill"    androID:background="@color/colorPrimary"    androID:layout_alignParentBottom="true"    androID:ID="@+ID/tabs"    app:layout_collapseMode="parallax"    app:layout_behavior="@string/appbar_scrolling_vIEw_behavior"    xmlns:androID="http://schemas.androID.com/apk/res/androID">    </androID.support.design.Widget.TabLayout></androID.support.design.Widget.CoordinatorLayout>

第三片段布局:

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:orIEntation="vertical" androID:layout_wIDth="match_parent"    androID:layout_height="match_parent">    <EditText        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"        androID:layout_margintop="40dp"        androID:hint="Enter something"        /></linearLayout>
解决方法 打开AndroIDManifest.xml并添加到您的活动代码中
机器人:windowsoftinputMode = “adjustPan”

如果这不起作用
机器人:windowsoftinputMode = “adjustnothing”

这将阻止软键盘调整布局.

希望这可以帮助.

总结

以上是内存溢出为你收集整理的android – (tablayout)当editText聚焦时,标签会越过键盘全部内容,希望文章能够帮你解决android – (tablayout)当editText聚焦时,标签会越过键盘所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1130754.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存