2016-04-08 15 views
-1

私は多くの方法を試みましたが、私は問題を解決できません。アンドロイドスタジオで 私はレンダリングとプレビューがありません。 (画像下)アンドロイドスタジオでレンダリングされていません

android studio

、これが私のactvity_mainコードです:

<?xml version="1.0" encoding="utf-8"?> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:theme="@style/AppTheme.AppBarOverlay"> 

    <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_main" /> 

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fab" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="bottom|end" 
    android:layout_margin="@dimen/fab_margin" 
    android:src="@android:drawable/ic_dialog_email" /> 

私は<include layout="@layout/content_main" />を削除し、私の問題を解決しますが完了していない、ので、私は私の携帯電話にウィジェットを追加することはできません。私は私のデバイスの画面上のボタンまたは任意のものを追加することはできません

custom view

、私は変更のテーマを試してみました(画像下のように)、私は(22から21まで)変更APIレベルを試してみました、私は何度も構築してみましたプロジェクトを再構築してクリーンアップし、キャッシュを無効にする/再開しても問題は解決しませんでした。

これは私のcontent_main.xmlコードです:(私はアクティビティのメインコードのコンテンツコードを置き換えますが、アプリは白いページしか表示されません!!):

コード:

<?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="barnamenevis.fdsoft.farzam.test.MainActivity"> 

    <TextView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Hello World!" /> 
</RelativeLayout> 
+0

をAPI 23を使用する必要がありますか? –

+0

@BobMalooga私は付け加える。 –

+0

私は疑いがありました。 ''タグがありません。 –

答えて

関連する問題