相关疑难解决方法(0)

Android Studio渲染问题

我正在使用Android Studio 0.2.3,当正常打开活动布局时,预览应该出现在右侧,这样我就可以在文本设计模式之间切换,这将再次显示布局的预览.

但是当我处于文本模式或设计模式时,右侧都没有显示预览.我刚收到错误rendering problems...

当我编译所有内容并在我的设备上安装应用程序时,它可以正常运行.对于开发和试验布局,如果我可以使预览工作仍然会很好.

我也尝试在工作室中的不同设备之间切换,但没有成功.

有谁知道如何解决这个问题?

android android-version android-studio

191
推荐指数
7
解决办法
36万
查看次数

无法在Android studio中加载具有未知错误的AppCompat ActionBar

下面是我的xml文件.在预览中有两个错误"无法加载具有未知错误的AppCompat ActionBar"和"无法实现多个类".怎么能运行app.But应用程序崩溃,在Logcat中没有显示错误.

这是我的预览屏幕截图在此输入图像描述

<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">


    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="506dp" />

    <LinearLayout
        android:id="@+id/layout_main"
        android:orientation="vertical"
        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:weightSum="1"
        tools:context=".Activity.MainActivity">


    <LinearLayout
        android:id="@+id/main_layout"
        android:orientation="vertical"
        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:layout_weight="0.7"
        tools:context=".Activity.MainActivity">

        <!-- our tablayout to display tabs  -->
        <android.support.design.widget.TabLayout
            android:id="@+id/tabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            app:tabMode="scrollable"
            app:tabSelectedTextColor="@color/colorBlack"
            app:tabTextColor="@color/colorWhite"
            android:background="@color/colorOran"
            android:minHeight="?attr/actionBarSize"
            />

        <!-- View pager to swipe views -->
        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </LinearLayout>

        <LinearLayout
            android:id="@+id/ll"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:layout_alignParentBottom="true"
            android:background="#ffffff"
            android:orientation="horizontal"
            android:layout_weight="0.3"
            android:weightSum="4"
            tools:layout_editor_absoluteX="8dp" …
Run Code Online (Sandbox Code Playgroud)

android android-actionbar

151
推荐指数
9
解决办法
18万
查看次数

无法加载具有未知错误的AppCompat ActionBar

我的项目无法在预览中呈现布局.我的Android Studio版本3.1.2.我正在使用API​​ 28.这是我的activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 
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"
tools:context=".MainActivity"
android:id="@+id/frame_container">

<TextView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:text="Hello World"
    android:gravity="center"/>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

这很简单,只是将Hello World打印到布局,但它无法显示.错误如下: 预览错误

我搜索解决问题,解决方案是使用API​​ 26.我尝试,一切正常,预览成功.但是我创建片段活动,问题又回来了,预览无法显示. 如果您有新的解决方案,请帮助我!

android

5
推荐指数
2
解决办法
3475
查看次数

Android Studio 3.0布局预览呈现问题

我刚刚将我的Android Studio更新到最新的3.0,然后布局预览不再起作用了.我试过打开不同的项目,它们都有相同的渲染问题.在我检查时,我没有看到任何编译错误或gradle问题.到目前为止,我试过了

  • 建设项目
  • 刷新布局
  • 清洁项目
  • 无效的缓存/重新启动

以下附带的屏幕截图显示某些类无法启动,但我不知道为什么以及如何解决它们.非常感谢你.任何提示都可以提供帮助.

布局redering

更新:Android Studio 3.0布局编辑器中的Render错误似乎存在重复案例,但我的问题略有不同.上述链接问题的解决方案是通过澄清Base.Theme.AppCompat.Light.DarkActionBar下的父主题将主题修改为更具体的主题.但是,我甚至没有ActionBar所以我正在寻找Theme.AppCompat.NoActionBar的解决方案.

在更新到3.0之前,一切都很好.我想知道是否需要更改部署SDK /版本.

android android-layout android-studio android-studio-3.0

4
推荐指数
1
解决办法
1万
查看次数