android 输入法出现挤压屏幕、android输入键盘覆盖了屏幕控件的解决办法


如果希望输入法键盘弹出时不自动向上挤压activity,在activty中设置属性android:windowSoftInputMode="adjustPan"即可。

<activity android:name="testActivity"
      android:windowSoftInputMode="adjustPan">

希望输出的是纯数字键盘:

    <style name="editFont" parent="@android:style/TextAppearance.Widget.EditText">
        <item name="android:layout_width">fill_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="android:textColor">@color/black</item>
        <item name="android:textSize">18dp</item>
        <item name="android:singleLine">true</item>
        <item name="android:numeric">integer</item>
        <item name="android:digits">1234567890.</item>
    </style>

直接引用style即可。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM