Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 隐藏在ActionBar后面的Listview_Android_Xamarin.android - Fatal编程技术网

Android 隐藏在ActionBar后面的Listview

Android 隐藏在ActionBar后面的Listview,android,xamarin.android,Android,Xamarin.android,我试图解决这个问题,但我对Xamarin非常陌生。Android开发,我想我在某个地方搞砸了 我的问题很简单,我的listview从actionbar后面开始,如屏幕截图所示 我的代码如下,其中我有一个列表视图 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orient

我试图解决这个问题,但我对Xamarin非常陌生。Android开发,我想我在某个地方搞砸了

我的问题很简单,我的listview从actionbar后面开始,如屏幕截图所示

我的代码如下,其中我有一个列表视图

    <?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"
    android:theme="@style/Theme.CustomListView">
    <View
        android:layout_width="match_parent"
        android:layout_height="15dp"
        android:background="#000" />
    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <ListView
            android:id="@+id/XMLlist1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="20dp"
            android:divider="#B7D3FA" />
    </android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
有什么想法吗

我的Listview,项目如下,如果可以解释的话

<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="wrap_content"
    android:orientation="vertical"
    android:background="#f2f2f2"
    android:elevation="8dp"
    android:layout_margin="10dp">
    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="#fff"
        android:layout_margin="10dp">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_margin="10dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
                <ImageView
                    android:id="@+id/webIcon"
                    android:layout_width="45px"
                    android:layout_height="45px"
                    android:src="@drawable/Icon"
                    android:scaleType="centerCrop" />
                <TextView
                    android:id="@+id/nameTextView"
                    android:layout_marginLeft="16dp"
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="Fox News ."
                    android:textColor="@color/listsub1"
                    android:textSize="14dp"
                    android:layout_gravity="center" />
                <TextView
                    android:id="@+id/time"
                    android:layout_weight="0.6"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="2 day ago"
                    android:textColor="@color/listsub1"
                    android:textSize="14dp"
                    android:layout_gravity="center" />
                <ImageView
                    android:id="@+id/more"
                    android:visibility="invisible"
                    android:layout_width="15dp"
                    android:layout_height="22dp"
                    android:src="@drawable/more"
                    android:layout_gravity="center" />
            </LinearLayout>
            <LinearLayout
                android:layout_marginTop="12dp"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">
                <LinearLayout
                    android:layout_weight="1"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:layout_marginRight="5dp">
                    <TextView
                        android:id="@+id/departmentTextView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Android"
                        android:lines="3"
                        android:textSize="17dp"
                        android:textColor="@color/listtext"
                        android:lineSpacingExtra="3dp"
                        android:maxLines="3" />
                    <TextView
                        android:id="@+id/newssub"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="Android"
                        android:layout_marginTop="13dp"
                        android:textSize="13dp"
                        android:textColor="@color/listsub1"
                        android:lineSpacingExtra="3dp" />
                    <TextView
                        android:id="@+id/intrest"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="You've shown interest in iPhone"
                        android:textSize="12dp"
                        android:textColor="@color/listsub2"
                        android:maxLines="1"
                        android:layout_marginTop="13dp" />
                </LinearLayout>
                <LinearLayout
                    android:layout_weight="2.2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <ImageView
                        android:id="@+id/photoImageView"
                        android:layout_width="200px"
                        android:layout_height="200px"
                        android:src="@drawable/Icon"
                        android:scaleType="fitXY" />
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </android.support.v7.widget.CardView>
</LinearLayout>

删除

android:theme="@style/Theme.CustomListView"
移除

<View
    android:layout_width="match_parent"
    android:layout_height="15dp"
    android:background="#000" />

谢谢你的回复,它没有改变任何东西-也是在我的
主题中。CustomListView
我没有任何属性,它是一个占位符,以后要使用
你想不想添加ActionBar?你放的xml是完整的吗?你太棒了,非常感谢你,我没有意识到我可以像这样添加paddingTop。为此干杯,
<View
    android:layout_width="match_parent"
    android:layout_height="15dp"
    android:background="#000" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:orientation="vertical"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:paddingTop="?android:attr/actionBarSize">