簡體   English   中英

Android:第一個ListView元素位於TitelBar下

[英]Android: First ListView element is under the TitelBar

我的titleBar有問題,我很害怕。 當我在Android虛擬機中運行項目時,一切看起來都很好,但是在設備上,ListView的第一個元素消失在titleBar下。 與虛擬機上的Drawer相同,一切都很好,在設備上,前兩個元素位於titleBar下。

 <?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>

在列表視圖中嘗試

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM