天呢,为了这么简单的问题,写个文章是不是太傻了,嗯!!是的!!但是真的没找到这个问题的解决办法呢,这个alertdialog在4.4以上系统一切正常 但是 在华为4.4和红米4.4出现了白色底部这么都去不掉!!!!!!好像大家都没有遇到嘛,为啥只有我遇到了呢,果然是bug多多呀!!!

来看一下不适配的方法:

Method1:

AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this, R.style.AlertDialogCustom);

AlertDialog dialog = builder.create();

dialog.setCanceledOnTouchOutside(false);

dialog.setCancelable(false);

this.setFinishOnTouchOutside(false);

View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.layout_startgps, null);

dialog.setView(view);

dialog.show();

 

以上解决办法其实5.5以上适配的是好好的 但是呢,4.4系统的宝宝我真的是用AlertDialog 试了好久呜呜呜:终于找到了另一个解决办法,当然依然还是用AlertDialog,但是我们用contentview():

 

Meyhod 2:

 

 

 

 

 

 

 

更多相关文章

  1. Nginx系列教程(六)| 手把手教你搭建 LNMP 架构并部署天空网络电影
  2. Android(安卓)系统C++智能指针----总结
  3. Android使用系统文件管理器选择文件,并将Uri转换为File
  4. 谷歌加强Android监管,你的安卓机用起来会更持久
  5. Android驱动之 Linux Input子系统之TP——A/B(Slot)协议
  6. [置顶] Android(安卓)进程常驻(5)----开机广播的简单守护以及总结
  7. Android(安卓)Studio运行程序出现Session ‘app’: Error Launch
  8. Android嵌入式启动篇
  9. Android(安卓)6.0新特性之Doze模式

随机推荐

  1. Android短信转发默认不需要转发号码修改
  2. android中如何在代码中直接设置View的lay
  3. mount android yaffs image on ubuntu
  4. android 学习笔记有用代码片段(2)
  5. Android 实现旋转键盘的例子
  6. Android实现CoverFlow效果三
  7. android 中对xml 进行解析
  8. Android 平台如何获取程序的版本
  9. Android实现自动定位城市并获取天气信息
  10. Android SDK Tools 19出了