<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/drawer_layout"
android:fitsSystemWindows="true"
tools:context="com.example.sujin.trinity.HomePageActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay"
android:background="#ffffff">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_home_page" />
<fragment
android:id="@+id/fragment_navigation_drawer"
android:layout_width="350dp"
android:layout_height="match_parent"
android:layout_gravity="start"
app:layout="@layout/fragment_navigation_drawer"
tools:layout="@layout/fragment_navigation_drawer"
android:name="com.example.sujin.trinity.NavigationDrawerFragment"
/>
</android.support.v4.widget.DrawerLayout>
content
düzen dosyasıdır: android:background="#ffffff"
kullanıldığı zamanDrawerLayout Hata ile AppBarLayout çözmek için nasıl İşte
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.sujin.trinity.HomePageActivity"
tools:showIn="@layout/activity_home_page">
<CalendarView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/calendarView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="182dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="84dp"
android:textColor="#000000" />
</RelativeLayout>
[
, ilk çıkış görülmektedir ancak diğer TextView gibi öğeler görünmez.
android:background="#ffffff"
kullanılmadığında, ikinci çıktı gözlenir, ancak TextView gibi diğer öğeler görünmez. Bu hatayı nasıl çözebilirim?
Ne TextView göstermeye çalışıyorsunuz? Lütfen içerik düzeninizi ekleyin. –
"AppBarLayout", "ViewGroup" ana içeriğinin içinde olmalıdır. Şu anda ana içeriğin kendisi gibi davranıyor. 'AppBarLayout' ve' 'd düzenini başka bir' ViewGroup' içine yerleştirin; ör. bir "LinearLayout" veya bir "RelativeLayout". –
@ cricket_007 İçerik düzenini ekledim –