Android 对话框:删除标题字符串
我有一个奇怪的行为,其来源无法准确地确定。
我有我的申请经典
删除标题字符串 / 地位。
然后我创建一个对话框,允许用户输入信息 /名称等/
物理键盘没有问题,但是当我使用虚拟键盘时,我有一个奇怪的行为:
每次我按虚拟键盘上的键,标题字符串/通过移动整个键盘布局,再次出现状态,然后再次消失。 /就像启动应用程序时一样喜欢动画/
这是某种代码 :
进而
我试过了
但这会导致我的申请失败。
这个 xml
我有我的申请经典
requestWindowFeature/Window.FEATURE_NO_TITLE/;
删除标题字符串 / 地位。
然后我创建一个对话框,允许用户输入信息 /名称等/
物理键盘没有问题,但是当我使用虚拟键盘时,我有一个奇怪的行为:
每次我按虚拟键盘上的键,标题字符串/通过移动整个键盘布局,再次出现状态,然后再次消失。 /就像启动应用程序时一样喜欢动画/
这是某种代码 :
dialog = new Dialog/context/;
dialog.setContentView/R.layout.logindialog/;
dialog.setTitle/"Login:"/;
WindowManager.LayoutParams a = dialog.getWindow//.getAttributes//;
// dialog.requestWindowFeature/Window.FEATURE_NO_TITLE/;
a.dimAmount = 0;
dialog.getWindow//.setAttributes/a/;
dialog.setCancelable/true/;
dialog.getWindow//.setLayout/LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT/;
进而
dialog.show//;
我试过了
dialog.requestWindowFeature/Window.FEATURE_NO_TITLE/;
但这会导致我的申请失败。
这个 xml
<textview android:gravity="fill" android:id="@+id/LoginText" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Login:">
</textview>
<edittext android:id="@+id/LoginEdit" android:layout_height="wrap_content" android:layout_width="200sp" android:singleline="true" android:text="jason"></edittext>
<textview android:id="@+id/PasswordText" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Password:">
</textview>
<edittext android:id="@+id/PasswordEdit" android:layout_height="wrap_content" android:layout_width="200sp" android:password="true" android:singleline="true" android:text="welcome"></edittext>
<linearlayout android:gravity="center_horizontal" android:id="@+id/test2" android:layout_height="wrap_content" android:layout_width="wrap_content" android:orientation="horizontal">
<button android:id="@+id/LoginButton" android:layout_centerhorizontal="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Login"></button>
<button android:id="@+id/CreateButton" android:layout_centerhorizontal="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Create"></button>
<button android:id="@+id/CancelLogin" android:layout_centerhorizontal="true" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="Cancel"></button>
</linearlayout>/>
没有找到相关结果
已邀请:
13 个回复
龙天
赞同来自:
快网
赞同来自:
然后将其添加到清单:
奔跑吧少年
赞同来自:
如果您正在使用
AppCompatDialog
试试吧
重要的提示:
在调用之前设置此值。 setContentView.
dialog.supportRequestWindowFeature/Window.FEATURE_NO_TITLE/;
董宝中
赞同来自:
这里是 activity_no_title_dialog
董宝中
赞同来自:
你只是定义了这个话题
在您不想显示标题字符串的行动中
例子
:-
</application>
董宝中
赞同来自:
奔跑吧少年
赞同来自:
笔记: -
上面的代码应该在上面使用。
在 XML 使用主题
还 styles.xml
:
进而:
石油百科
赞同来自:
我使用动作并以对话的形式显示它。 我敲了主题,遇到了默认主题的有用部分。
这是我的代码
, 显示标题字符串显示的情况下:
这是一个让我带来所需结果的更改:
正如我所说,我还是新的 Android, 因此它可以具有不必要的副作用,但似乎它给了我所需的结果,这只是为了从对话框中删除标题字符串。
三叔
赞同来自:
所以,我尝试使用以下内容:
此选项可以正常工作。
快网
赞同来自:
我的用户对话的活动
:
activity_alert_dialogue.xml
:
宣言
:
风格
:
喜特乐
赞同来自:
https://github.com/00ec454/pop
窗户 android. 在您的活动中使用很容易。
按下“发送”按钮时,请在上面打开后尝试以下代码 lib 进入你的代码
为您添加一行 gradle 你顺利
石油百科
赞同来自:
喜特乐
赞同来自:
dialog1.requestWindowFeature/Window.FEATURE_NO_TITLE/;