FEATURE_NO_TITLE works when creating a dialog from scratch, as in:

Dialog dialog = new Dialog(context); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 

But it doesn't work when creating an AlertDialog (or using the Builder), because it already disables the title and use a custom one internally.

I have looked at the SDK sources, and I think that it can't be worked around. So to remove the top spacing, the only solution is to create a custom dialog from scratch IMO, by using the Dialog class directly.

Also, one can do that with a style, eg in styles.xml:

<style name="FullHeightDialog" parent="android:style/Theme.Dialog">  <item name="android:windowNoTitle">true</item> </style> 

And then:

Dialog dialog = new Dialog(context, R.style.FullHeightDialog); 

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android(安卓)input处理机制(二)改键机制
  2. Android开发UI之在子线程中更新UI
  3. Android读写文件汇总
  4. Android(安卓)studio开发用startForegrou
  5. Android杂谈---获取手机屏幕大小
  6. android studio 添加阿里云仓库
  7. weex打包android apk的坑
  8. android中java与lua的相互调用
  9. 第一章 Android开发环境搭建
  10. Android Studio中的Clean(清洁)、build(构建