Android Studio Update: preview adding shadow in XML

Asked

Viewed 158 times

0

Since the last update to Android Studio 3.3, a shadow appeared on each of my elements in the XML preview layout. Although it doesn’t appear in compiled rendering, it gets in the way of editing.

How do I remove them? or is this a BUG? is very boring

It’s not in coding, because it’s like this in all views:

<?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:foreground="?attr/selectableItemBackground"
    android:orientation="vertical">

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="14dp"
    >

    <LinearLayout
        android:id="@+id/linearMain"
        android:layout_width="85dp"
        android:layout_height="85dp"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@drawable/shape_notificacao_drawable"
            android:orientation="vertical"
            >

            <TextView
                android:id="@+id/txtDia"
                style="@style/titulosGrande"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="09"
                android:textColor="@color/secondary_text"
                />

            <TextView
                android:id="@+id/txtMes"
                style="@style/titulosGrande"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:text="Set"
                android:textColor="@color/fonte_cinza"
                android:textSize="18sp"
                />

        </LinearLayout>

    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginStart="16dp"
        android:layout_marginLeft="16dp"
        android:layout_toEndOf="@+id/linearMain"
        android:layout_toRightOf="@+id/linearMain"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            android:layout_marginEnd="10dp"
            >

            <TextView
                android:id="@+id/txtTitulo"
                style="@style/titulosPequenos"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:gravity="center_vertical"
                android:text="Titulo da notificação"
                android:textSize="18sp"
                android:textStyle="normal"
                />

        </LinearLayout>

        <TextView
            android:id="@+id/txtDescricao"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/textoNormal"
            android:layout_marginTop="4dp"
            android:gravity="start"
            android:ellipsize="end"
            android:maxLines="3"
            android:text="Pet Shop Ciade Nova está com uma promoção de banhos toda quarta-feira!"
            android:textSize="12sp"
            android:layout_marginEnd="10dp"
            android:textColor="@color/fonte_cinza"
            />

        <LinearLayout
            android:id="@+id/linearTextoAdicional"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            >

            <TextView
                android:id="@+id/txtAdicional"
                style="@style/textoNormal"
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:layout_marginTop="7dp"
                android:layout_centerInParent="true"
                android:background="@drawable/shape_chip_drawable"
                android:text="Eu quero!"
                android:gravity="center"
                android:textSize="12sp"
                android:textColor="@color/secondary_text"
                />

        </LinearLayout>


    </LinearLayout>

</RelativeLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="0dp"
    android:layout_marginStart="14dp"
    android:layout_marginEnd="14dp"
    >

    <include layout="@layout/divisor_mono" />

</LinearLayout>

inserir a descrição da imagem aqui

  • I do not use Android Studio so I will not talk nonsense, but see this reply in the SOEN

  • Thanks for the tip, but as he himself said that he did not find any way to disable (only in the new beta version), this appeared dps of the update of the 3.3

1 answer

6


That’s a bug: Linearlayout Rendering issues in Android Studio 3.3.

The problem has been solved, and will be available in the next release:

For the shadow in Linearlayout, Actually we use it to indicate the Direction of Linearlayout. But we agree it is quite annoying for Seeing a clear preview.

So we remove that shadow when Linearlayout is not Selected. It would be release in the following version.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.