简体   繁体   English

如何在9patch上正确应用adjust_pan?

[英]how to apply adjust_pan on 9patch correctly?

I have an android dialog with EditText in it. 我有一个带有EditText的android对话框。

When the user clicks the EditText, the keyboard is opened 当用户单击EditText时,键盘被打开

but the dialog is shrink. 但是对话框缩小了。

The dialog root background is a 9patch 对话框的根背景是9patch

I want it to be cut, meaning its corners won't be rounded but square. 我希望将其切掉,这意味着它的角不是圆的而是正方形的。

Now, the user might think the shrink dialog is the dialog full size. 现在,用户可能会认为收缩对话框是完整尺寸的对话框。

I want the keyboard to be laid on the dialog in a way the user will see the dialog is originally larger there are not visible fields. 我希望键盘以某种方式放置在对话框上,使用户可以看到对话框本来是较大的,没有可见的字段。

在此处输入图片说明

I have tried this on the activity that opens the dialog: 我在打开对话框的活动中尝试过此操作:

      mDialog.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);

manifest: 表现:

android:windowSoftInputMode="adjustPan" 

See my similar answer here: https://stackoverflow.com/a/22463549/335650 在这里看到我的类似答案: https : //stackoverflow.com/a/22463549/335650

Is any part of your layout a scrollable container (like ListView)? 布局的任何部分是否为可滚动容器(如ListView)? If so, try setting android:isScrollContainer="false" on that item in your XML layout. 如果是这样,请尝试在XML布局中的该项目上设置android:isScrollContainer =“ false”。

If you have any views which have android:isScrollContainer="true", the layout manager will attempt to resize your layout when the keyboard pops up, regardless of `android:windowSoftInputMode'. 如果您有任何具有android:isScrollContainer =“ true”的视图,则无论“ android:windowSoftInputMode”如何,布局管理器都会在键盘弹出时尝试调整您的布局大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM