Android的AlertDialog不显示在某些设备上整个setMessage [英] Android AlertDialog not displaying entire setMessage on certain devices

查看:926
本文介绍了Android的AlertDialog不显示在某些设备上整个setMessage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是最近刚刚提请我注意一个奇怪的情况。我有一个显示在创建时警告说,来完成他们需要重新启动的过程中用户的AlertDialog的活动。在我的设备(Galaxy Nexus的),它显示就好了。这只是最近引起了我的注意,在很多其他设备的其唯一被切断之前显示的几句话。

This is an odd case that was just recently brought to my attention. I have an activity that displays an AlertDialog when it is created to warn the user that to complete the process they need to reboot. On my device (Galaxy Nexus) it displays just fine. It was just recently brought to my attention that on a lot of other devices its only displaying a few words before being cut off.

        AlertDialog.Builder builder = new AlertDialog.Builder(ReportActivity.this);
        builder.setTitle("Finished!");
        builder.setMessage("Due to the different storage mediums across the various Android devices this app may eb used for, "
                                            +"I've decided not to force a media rescan because depending on your device, "
                                            +"it may or may not even be possible. "
                                            +"This means that you will need to reboot your device or unmount/mount your sdcard in the Settings app before most players will pull in all the information for the songs."
                                            +"\n Please reboot or rescan before claiming that the app did not work.")
               .setCancelable(false)
               .setPositiveButton("Dismiss", new DialogInterface.OnClickListener() {
                   public void onClick(DialogInterface dialog, int id) {
                                    dialog.dismiss();
                            lv1.setAdapter(new ResultsAdapter(ReportActivity.this, results));
                   }
               });

            AlertDialog alert = builder.create();
            alert.show();

推荐答案

而不是使用 setMessage(),试试的setView(),你在自己的的TextView 在这里你可以控制所显示的行数。

Rather than use setMessage(), try setView(), supplying your own TextView where you can control the number of lines that are displayed.

这篇关于Android的AlertDialog不显示在某些设备上整个setMessage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆