2016-02-29 39 views
1

我有一個問題,我的標題欄,我嚇壞了。當我在Android虛擬機中運行項目時,一切看起來都很好,但在設備上,ListView的第一個元素在titleBar下消失了。我的抽屜在虛擬機上的一切都很好,在設備上頭兩個元素在titleBar下。Android:第一個ListView元素在TitelBar下

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v4.widget.DrawerLayout 
    android:id="@+id/fragment_container_idea" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    xmlns:android="http://schemas.android.com/apk/res/android" > 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 

    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    tools:context="***"> 

    <ListView 
     android:id="@+id/list" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentLeft="true" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentBottom="true" 
     android:layout_alignParentTop="true"/> 

    </LinearLayout> 
    </android.support.v4.widget.DrawerLayout> 
+0

嘗試本作的ListView的母公司是LinearLayour 機器人:layout_alignParentLeft = 「真」 機器人:layout_alignParentStart = 「真」 機器人:layout_alignParentBottom = 「true」等 –

回答

0

爲什麼要使用這些線路中的ListView

android:layout_marginTop="20dp" 
android:paddingTop="10dp" 
+0

這可行,但感覺不適合設置靜態填充。 – Fearghus

+0

並且通過設置listview填充未解決抽屜問題。似乎佈局不知道有一個titelbar。 – Fearghus

相關問題