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”。对我来说,我希望它表现得像“匹配父母”。身高对我来说无关紧要。但是,谢谢你的帮助,这似乎太武断了。。。?