Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/203.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android can';设置对话框大小_Android_Xml_Size_Android Alertdialog - Fatal编程技术网

Android can';设置对话框大小

Android can';设置对话框大小,android,xml,size,android-alertdialog,Android,Xml,Size,Android Alertdialog,我的alertdialog有一个固定的最大尺寸,它是一个完美的正方形,边长为min(父宽度、父高度)。这就产生了一个问题,我无法将警报对话框设置为宽屏幕 在对话框中,我加载了一个imageview以显示图像。我希望这张图片能在大屏幕上显示,而不是在一个正方形中,这会使它变小 活动中的警报对话框的代码: AlertDialog.Builder alertadd = new AlertDialog.Builder(MainActivity.this); LayoutInflater factory

我的
alertdialog
有一个固定的最大尺寸,它是一个完美的正方形,边长为
min(父宽度、父高度)
。这就产生了一个问题,我无法将
警报对话框
设置为宽屏幕

在对话框中,我加载了一个
imageview
以显示图像。我希望这张图片能在大屏幕上显示,而不是在一个正方形中,这会使它变小

活动中的警报对话框的代码:

AlertDialog.Builder alertadd = new AlertDialog.Builder(MainActivity.this);
LayoutInflater factory = LayoutInflater.from(MainActivity.this);
final View view = factory.inflate(R.layout.schematic_image_view, null);
alertadd.setView(view);
alertadd.show();
xml文件的代码schematic\u image\u view.xml

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout_root" 
    android:orientation="horizontal"
    android:layout_width="match_parent" 
    android:layout_height="match_parent"
    android:padding="0dp">

    <ImageView 
         android:id="@+id/schematic" 
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:scaleType="fitXY"
         android:src="@drawable/schematic">
    </ImageView>