Всплывающее окно просмотра другой проблемы ориентации в Android - PullRequest
0 голосов
/ 12 августа 2011

У меня горизонтальный ориентированный вид, и я хочу показать на нем всплывающий вертикальный вид.Даже если я установил вертикальную ориентацию в моем всплывающем слое, он выглядит горизонтальным.

Мой всплывающий вид XML выглядит так:

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android" 
  android:weightSum="1" android:orientation="vertical"
   android:layout_width="wrap_content" android:layout_height="fill_parent">
    <LinearLayout android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:layout_weight="0.35" android:layout_width="321dp">
        <Button android:text="Button" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
    </LinearLayout>

</LinearLayout>

И в моем файле манифеста xml:

    <activity android:name="PopUpLayer" android:label="@string/app_name" 
        android:theme="@android:style/Theme.Dialog" >

Спасибо за любую помощь.

Ответы [ 2 ]

0 голосов
/ 12 августа 2011

Я не думаю, что вы можете иметь альбомную ориентацию и всплывающее окно с портретом одновременно, если вы это имеете в виду.

0 голосов
/ 12 августа 2011

Я изменил ваш xml следующим образом. Теперь проверьте.

<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android" 
  android:weightSum="1" android:orientation="vertical"
   android:layout_width="wrap_content" android:layout_height="fill_parent">
    <LinearLayout android:id="@+id/linearLayout1" android:layout_height="wrap_content" android:layout_weight="0.35" android:layout_width="321dp" android:orientation="vertical">
        <Button android:text="Button" android:id="@+id/button1" android:layout_height="wrap_content" android:layout_width="fill_parent"></Button>
    </LinearLayout>

</LinearLayout>

Если не работает, посмотрите это:

 <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        >
        <LinearLayout android:layout_width="wrap_content" android:orientation="vertical" android:layout_height="match_parent" android:id="@+id/linearLayout1">

 <Button android:text="Button" android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
        <Button android:text="Button" android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>   
        </LinearLayout>


    </LinearLayout>

Хорошо. Теперь посмотрите вывод следующего xml.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <LinearLayout android:layout_width="wrap_content" android:orientation="horizontal" android:layout_height="match_parent" android:id="@+id/linearLayout1">
    <Button android:text="Button" android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
    <Button android:text="Button" android:id="@+id/button4" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
     </LinearLayout>


</LinearLayout>
...