据我们所知,Android Studio预览版android.support.v4.widget.DrawerLayout
存在问题,我们无法看到"android.support.v4.widget.DrawerLayout"
的任何内容。
所以,这太糟糕了,我们花了很多时间来设计活动。
我的问题是,
在下面的教程中是否有替换器可以执行此操作? (用于在Android Studio上显示预览)
http://www.android4devs.com/2014/12/how-to-make-material-design-navigation-drawer.html
例如,这是我的 Main_activity
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/DrawerLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:elevation="7dp">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
android:id="@+id/tool_bar"
layout="@layout/tool_bar">
</include>
<android.support.v7.widget.CardView
android:layout_height="155dp"
android:layout_width="match_parent"
android:layout_margin="@dimen/outer_margin">
<ImageButton
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:src="@drawable/bg"/>
</android.support.v7.widget.CardView>
<Button
android:layout_width="300dp"
android:layout_height="50dp"
android:layout_marginLeft="50dp"
android:layout_marginRight="70dp"
android:text="@string/button"
android:textAllCaps="false"
android:id="@+id/button"
tools:ignore="RtlHardcoded"/>
<android.support.v7.widget.CardView
android:layout_height="100dp"
android:layout_width="match_parent"
android:layout_marginTop="0dp"
android:layout_marginLeft="@dimen/outer_margin"
android:layout_marginBottom="@dimen/outer_margin"
android:layout_marginRight="@dimen/outer_margin">
<TextView
style="@style/Base.TextAppearance.AppCompat.Headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Title2"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_height="100dp"
android:layout_width="match_parent"
android:layout_marginTop="0dp"
android:layout_marginLeft="@dimen/outer_margin"
android:layout_marginBottom="@dimen/outer_margin"
android:layout_marginRight="@dimen/outer_margin">
<TextView
style="@style/Base.TextAppearance.AppCompat.Headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Title3"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_height="100dp"
android:layout_width="match_parent"
android:layout_marginTop="0dp"
android:layout_marginLeft="@dimen/outer_margin"
android:layout_marginBottom="@dimen/outer_margin"
android:layout_marginRight="@dimen/outer_margin">
<TextView
style="@style/Base.TextAppearance.AppCompat.Headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Title4"/>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_height="100dp"
android:layout_width="match_parent"
android:layout_marginTop="0dp"
android:layout_marginLeft="@dimen/outer_margin"
android:layout_marginBottom="@dimen/outer_margin"
android:layout_marginRight="@dimen/outer_margin">
<TextView
style="@style/Base.TextAppearance.AppCompat.Headline"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Title4"/>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<android.support.v7.widget.RecyclerView
android:id="@+id/RecyclerView"
android:layout_width="320dp"
android:layout_height="match_parent"
android:layout_gravity="left"
android:background="#ffffff"
android:scrollbars="vertical">
</android.support.v7.widget.RecyclerView>
</android.support.v4.widget.DrawerLayout>
Build.gradle依赖项:
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:support-v4:22.1.1'
Android Studio版本: AI 141.1962279 From Canary Channel
如何在Android Studio预览版中显示此内容?或替换为此?
“android.support.v4.widget.DrawerLayout”