【发布时间】:2017-03-29 04:33:51
【问题描述】:
我正在 Visual Studio 中构建一个 android 应用程序。在我的 feed.axml 文件中,我的主体内容浮动在我的标题栏上方。它应该在标题栏下方。我很困惑为什么我的代码会这样做。
my android app as of this post 此图像中显示在标题栏上方的内容是卡片和大文本。如果有人知道如何在标题栏下方浮动这些元素,请告诉我。
任何帮助将不胜感激
这是我的 xml 代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.DrawerLayout xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_height="match_parent"
android:layout_width="fill_parent"
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cardView1" />
<TextView
android:text="hello world"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView1" />
<include
layout="@layout/toolbar" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_height="match_parent"
android:layout_width="300dp"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header" />
</android.support.v4.widget.DrawerLayout>
【问题讨论】:
-
您有
<CardView>和<TextView>列在垂直<LinearLayout>的工具栏<include>之前。如果您希望它们在下方,请将它们移到其后面。
标签: android xml layout xamarin.android