Edittext hide under keyboard when edittext create on RunTime

后端 未结 2 814
遥遥无期
遥遥无期 2021-01-29 10:09

I have a layout with scroll view as root layout with one linear layout as child with vertical orientation. I add a list of edit text dynamically in linear layout onCreate of ac

相关标签:
2条回答
  • 2021-01-29 10:38

    In your Manifest file add the following code for this particular activity

    <activity android:windowSoftInputMode="adjustPan">
    

    or

    Activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
    
    0 讨论(0)
  • 2021-01-29 10:41
    <activity
                android:name=".ActivityName"
                android:screenOrientation="nosensor"
                android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
    

    Use nosensor if you want to use the app only for portrait modes. Use stateAlwaysHidden in the if you don't want android to pop that keyboard up everytime your activity opens.

    Check out this link the official documentation and check other stackoverflow answers.

    0 讨论(0)
提交回复
热议问题