definierte xml-layout-in-layout-land erscheint nicht in android-Anwendung

Bin ich eine Anwendung entwickeln, die nach dieses Beispiel. Definierte ich ein Querformat-layout für header.xml in einem layout-land", aber wenn ich ändern Sie die Ausrichtung zu Querformat, definierte layout wird nicht auf dem Bildschirm erscheinen.

Wissen, Warum ?

Dank

Aktualisiert :

Tätigkeit Code :

public class ACENewsFeedActivity extends ListActivity {

    //Progress Dialog
    private ProgressDialog pDialog;

    //Array list for list view
    ArrayList<HashMap<String, String>> rssItemList = new ArrayList<HashMap<String,String>>();

    RSSParser rssParser = new RSSParser();

    List<RSSItem> rssItems = new ArrayList<RSSItem>();

    RssFeed rssFeed;

    private static String TAG_TITLE = "title";
    private static String TAG_LINK = "link";
    private static String TAG_DESRIPTION = "description";
    private static String TAG_PUB_DATE = "pubDate";
    //private static String TAG_GUID = "guid"; //not used

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.rss_item_list);

        /**
         * Calling a backgroung thread will loads recent articles of a website
         * @param rss url of website
         * */
        new loadRSSFeedItems().execute();
       }

       ....
}

XMl-Layout im landscape-Modus :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layoutHeader"
    android:layout_width="fill_parent"
    android:layout_height="50dip"
    android:layout_alignParentTop="true"
    android:background="@layout/header_gradient"
    android:orientation="horizontal">

    <!-- Logo -->

    <!-- Refresh -->


    <!-- Plus Button -->

    <ImageButton
        android:id="@+id/btnAddSite"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_marginRight="5dip"
        android:background="@null"
        android:src="@drawable/plus"
        android:layout_centerVertical="true" />

    <ImageView
        android:id="@+id/logo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true"
        android:src="@drawable/logo" />

    <ImageView
        android:id="@+id/refreshList"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:src="@drawable/refresh" />

</RelativeLayout>
  • Können Sie nach dem code für die xml-und die Aktivität?
  • Verstehe ich richtig, dass Sie layouts in beiden layout-port und layout-Ordner landen, und das Lay-out-port ist die Ansicht in hochformat aber die layout-land zeigt nicht im Querformat?
  • Nein, habe ich nicht land-Hafen-Ordner, den ich erstellt layout-land neben layout (Standard-Ordner) enthalten Querformat-version von header.xml Datei. Bin Ich Im Recht ?
  • überprüfen Sie heraus diesen link developer.android.com/guide/topics/resources/...
  • Ja, beim Umschalten auf Querformat sollte geprüft werden, ob res/layout-land für eine header.xml und verwenden, wenn es vorhanden ist, bevor mit der man in res/layout. Allerdings, wenn Sie setzen eine in res/layout-land Sie können auch die anderen in res/layout-port da sind nur zwei Optionen für die Ausrichtung des Bildschirms. Dies wird definitiv auch verhindern, dass der in res/layout-port verwendet werden, die im Querformat (so kann es sein nützlich für debugging-Zwecke).
Schreibe einen Kommentar