在RTL语言android中切断对话框

在RTL语言android中切断对话框,第1张

概述我有这个代码在 android中显示自定义对话框.只有当前语言不是RTL时,它才能正常工作.一旦我们将语言更改为阿拉伯语,对话框就会切断: Dialog dialog = new Dialog(activityContext, R.style.MaterialDialogSheet); LayoutInflater layoutInflater = LayoutInflater.from( @H_301_4@ 我有这个代码在 android中显示自定义对话框.只有当前语言不是RTL时,它才能正常工作.一旦我们将语言更改为阿拉伯语,对话框就会切断:

Dialog dialog = new Dialog(activityContext,R.style.MaterialDialogSheet);    LayoutInflater layoutInflater = LayoutInflater.from(activityContext);    VIEw vIEw = layoutInflater.inflate(R.layout.error_dialog_vIEw,null);    dialog.setContentVIEw(vIEw);    dialog.setCancelable(isCancelable);    dialog.setCanceledOntouchOutsIDe(isCancelable);    TextVIEw errorTittleTextVIEw = (TextVIEw) dialog.findVIEwByID(R.ID.error_Title);    TextVIEw errorMessageTextVIEw = (TextVIEw) dialog.findVIEwByID(R.ID.error_message);    errorTittleTextVIEw.setText(activityContext.getString(R.string.error_dialog_Title).toupperCase());    errorMessageTextVIEw.setText(errorMessage.toupperCase());    return dialog;

虽然在英语中它显示如下:

可能是什么问题呢?

@H_301_4@解决方法 当我从以下位置更改对话框的XML布局时,问题已解决:

androID:layout_wIDth="wrap_content"androID:layout_height="wrap_content"

androID:layout_wIDth="match_parent"androID:layout_height="match_parent"
@H_301_4@ @H_301_4@ @H_301_4@ @H_301_4@ 总结

以上是内存溢出为你收集整理的在RTL语言android中切断对话框全部内容,希望文章能够帮你解决在RTL语言android中切断对话框所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存