<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_cardView01"
android:layout_alignRight="@+id/main_cardView01"
android:orientation="horizontal"
android:layout_gravity="top">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_script"
android:text="@string/script_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_script"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_addOn"
android:text="@string/addOn_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_addon"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_cardView01"
android:layout_alignRight="@+id/main_cardView01"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_map"
android:text="@string/map_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_map"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_skin"
android:text="@string/skin_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_skin"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_new_cardView"
android:layout_alignRight="@+id/main_new_cardView"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_texturePack"
android:text="@string/tp_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_texturepack"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/main_button_help"
android:text="@string/help_btn"
android:layout_margin="5dp"
android:theme="@style/main_button"
android:background="@drawable/main_button_help"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceMedium"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_top10_cardView"
android:layout_alignRight="@+id/main_top10_cardView"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/top10"
android:text="Top 10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textColor="#7A7A7A"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/text"
android:gravity="right"/>
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/main_top10_cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
android:foreground="@drawable/cardview">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/main_top10_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#5E5E5E"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#7a7a7a"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_new_cardView"
android:layout_alignRight="@+id/main_new_cardView"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/suggested"
android:text="Suggested"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textColor="#7A7A7A"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/text"
android:gravity="right"/>
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/main_suggested_cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
android:foreground="@drawable/cardview">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/main_suggested_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ID00010bREDSTONE"
android:textColor="#5E5E5E"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/USER_redstone"
android:textColor="#7a7a7a"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_new_cardView"
android:layout_alignRight="@+id/main_new_cardView"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/New"
android:text="New"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textColor="#7A7A7A"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/text"
android:gravity="right"/>
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/main_new_cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
android:foreground="@drawable/cardview">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/main_new_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#5E5E5E"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#7a7a7a"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:id="@+id/main_relativeLayout03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_CS_cardView"
android:layout_alignRight="@+id/main_CS_cardView"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/CS"
android:text="Coming Soon"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textColor="#7A7A7A"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/text"
android:gravity="right"/>
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/main_CS_cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
android:foreground="@drawable/cardview">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/main_CS_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#5E5E5E"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#7a7a7a"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/main_new_cardView"
android:layout_alignRight="@+id/main_new_cardView"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="16dp"/>
<TextView
android:id="@+id/updated"
android:text="Updated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_marginLeft="5dp"
android:textColor="#7A7A7A"
android:textAppearance="?android:attr/textAppearanceLarge"
android:background="@drawable/text"
android:gravity="right"/>
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/main_updated_cardView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="0dp"
app:cardElevation="2dp"
app:cardUseCompatPadding="true"
android:foreground="@drawable/cardview">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="vertical">
<ImageView
android:id="@+id/main_updated_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:adjustViewBounds="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#5E5E5E"
android:textAppearance="?android:attr/textAppearanceMedium"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#7a7a7a"
android:textAppearance="?android:attr/textAppearanceSmall"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<android.support.v4.widget.DrawerLayout
android:id="@+id/drawer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true">
<FrameLayout
android:id="@+id/drawer_layout"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="start">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center|center"
android:text="test"/>
</FrameLayout>
</android.support.v4.widget.DrawerLayout>
我想在我的项目中添加导航抽屉。我的来源看起来像第一个,第二个是导航抽屉,但是当我尝试添加导航抽屉时,只显示导航抽屉或只显示滚动视图。
但是我想要做的是一起使用导航抽屉和ScrollView(而不是导航抽屉里面的scrollView)
答案 0 :(得分:0)
使用导航抽屉作为活动的根视图的直接子项,并为您自己的代码添加另一个片段或布局(滚动视图)。此外,要求使用导航栏时,根视图应仅包含两个直接视图