Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/178.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 安卓主题面板全宽_Android_Xml_Width_Panel - Fatal编程技术网

Android 安卓主题面板全宽

Android 安卓主题面板全宽,android,xml,width,panel,Android,Xml,Width,Panel,我想要一个活动来测量整个屏幕的宽度,而不是屏幕的高度。 我想看看下面的活动 我在清单中使用此选项: <activity android:name="activities.Dialoger" android:label="@string/app_name" android:launchMode="singleTop" android:screenOrientation="portrait" android:the

我想要一个活动来测量整个屏幕的宽度,而不是屏幕的高度。 我想看看下面的活动

我在清单中使用此选项:

<activity
        android:name="activities.Dialoger"
        android:label="@string/app_name"
        android:launchMode="singleTop"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Panel"/>

但是,即使我在XML文件中写了以下内容,“dialoger”也不会使用整个宽度:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/semi_transparent"
    android:gravity="center"
    android:orientation="vertical">

那么,活动如何占据整个宽度呢?

没关系

我找到了解决办法。 在舱单中:

android:theme="@android:style/Theme.Panel"
在XML中:

android:minWidth="400dp"

android:layout\u width=“fill\u parent”:不,它不会改变任何东西……好的。好的,试试这个。不。。。主题为“@android:style/Theme.Panel”时,宽度的行为类似于“wrap\u content”。对我来说,我希望它表现得像“匹配父母”。身高对我来说无关紧要。但是,谢谢你的帮助,这似乎太武断了。。。?