final android.support.v7.app.AlertDialog builder = new android.support.v7.app.AlertDialog.Builder(this).create();builder.show();Window window = builder.getWindow();window.setContentView(R.layout.dialog_xieyi);// 设置弹出框加载的布局

原因出在xml布局上

在最外层根布局上添加margin,以实现弹窗边距效果,导致自定义布局无法填充dia窗口。

解决方案,设置子布局的宽度即可。

<com.zhy.autolayout.AutoLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"                                     android:layout_width="wrap_content"                                     android:layout_height="700px"                                     android:background="#ffffff"                                     android:orientation="vertical">    <com.zhy.autolayout.AutoLinearLayout        android:layout_width="660px"        android:layout_height="match_parent"        android:orientation="vertical">


更多相关文章

  1. MediaTest
  2. Android——ImageView设置圆形边框
  3. Android中fragment模式
  4. Java W3C 生成 XML
  5. android--widget之menu
  6. android GLSurfaceView 异常处理
  7. AdapterTest
  8. 简单的四种动画Demo
  9. 安卓如何关闭软键盘?

随机推荐

  1. Android Studio开发——百度地图定位
  2. layer-list 的用法
  3. fir.im Weekly - 如何进行 Android App
  4. React-Native:调用(Android)Native方法
  5. Android电话Phone设计框架介绍
  6. Android(安卓)4.0新增Space及GridLayout
  7. 装饰者模式及其应用
  8. android的UI和常用控件
  9. Android(安卓)Developers:按钮
  10. Android 链式调用(方法链)