首页 > 解决方案 > android studio 中的预览选项不起作用

问题描述

我在预览选项 [xml] 中的 android studio 中有一些问题

详情如下

我做了所有的事情。

  1. Gradle 已经构建
  2. 所有 xml 布局错误均已删除
  3. 还更改了 api 级别、屏幕分辨率、旋转和主题
  4. 重启 android studio 但什么也没有发生下面的图片链接

在此处输入图像描述

代码如下

<?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:card_view="http://schemas.android.com/tools"
   android:layout_width="match_parent"
   android:layout_height="match_parent">

   <android.support.design.widget.CollapsingToolbarLayout
       android:id="@+id/DT_ImageCardView"
       android:layout_width="match_parent"
       android:layout_height="150dp"
       app:cardBackgroundColor="@color/DarkGrayDark"
       app:contentScrim="?attr/colorPrimary"
       app:layout_scrollFlags="scroll|exitUntilCollapsed"
       card_view:cardPreventCornerOverlap="false">

       <ImageView
           android:id="@+id/DT_full_image"
           android:layout_width="match_parent"
           android:layout_height="match_parent"
           android:background="@color/colorPrimaryDark"
           android:contentDescription="@string/dailytipsimage"
           android:scaleType="fitXY"
           android:src="@drawable/trans_logo" />

       <ImageView
           android:id="@+id/DT_share"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_below="@id/DT_ImageCardView"
           android:background="@color/transparentBlack"
           android:contentDescription="@string/dailytipsshare"
           android:padding="5dp"
           android:src="@drawable/ic_share_white_24dp" />

   </android.support.design.widget.CollapsingToolbarLayout>


   <TextView
       android:id="@+id/DT_full_title"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:layout_below="@id/DT_ImageCardView"
       android:layout_marginTop="5dp"
       android:text="@string/jeetesh_surana"
       android:textAlignment="center"
       android:textSize="20sp"
       android:textStyle="bold" />

   <TextView
       android:id="@+id/DT_full_des"
       android:layout_width="match_parent"
       android:layout_height="wrap_content"
       android:layout_below="@id/DT_full_title"
       android:layout_margin="10dp" />

   <android.support.design.widget.FloatingActionButton
       android:id="@+id/DT_full_videoIV"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentRight="true"
       android:layout_below="@id/DT_full_des"
       android:layout_margin="10dp"
       android:padding="10dp"
       android:src="@drawable/ic_videocam_black_24dp"
       android:visibility="visible" />

   <Button
       android:id="@+id/DT_comment"
       android:layout_width="match_parent"
       android:layout_height="50dp"
       android:layout_alignParentBottom="true"
       android:layout_centerHorizontal="true"
       android:background="@color/colorPrimary"
       android:padding="10dp"
       android:text="@string/comment"
       android:textColor="@color/colorWhite" />

</RelativeLayout> 

标签: androidxmlandroid-layout

解决方案


首先在屏幕“!”的右上角向我们展示您的问题 每秒屏幕显示(如果我记得很清楚的话)你的屏幕还没有在我的旧电脑上加载甚至是 2-3 分钟才显示:)


推荐阅读