Android Studio 在 3.3 版的布局编辑器中禁用 textview 周围的阴影 [英] Android studio disable shadow around textview in layout editor in version 3.3

查看:31
本文介绍了Android Studio 在 3.3 版的布局编辑器中禁用 textview 周围的阴影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TextView 包裹在 LinearLayout in android studio 3.3 时,左右两边有奇怪的阴影.安装后此阴影不会出现在设备中,它只会出现在编辑器中.这是 android studio 中某些指示的错误或新功能吗?如果这是一个功能,有没有办法禁用它?

There is a weird shadow at the left and right of TextView when it is wrapped with in LinearLayout in android studio 3.3 . This shadow does not appear in device after installation , it only appears in editor . Is this a bug or new feature for some indication in android studio ? If this is a feature , Is there a way to disable it ?

test.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

<LinearLayout android:layout_width="wrap_content"
              android:layout_height="wrap_content">

    <TextView android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Shadow Appear"/>
</LinearLayout>
</RelativeLayout>

推荐答案

阴影只是为了突出显示 LinearLayout 方向,而在预览时而不是在安装应用程序时.

The shadow is just to highlight LinearLayout orientation while in preview and not when the app is installed.

LinearLayout 有两个方向选项:horizo​​ntal &垂直.默认情况下,如果未声明,则方向被视为 horizo​​ntal,从而在垂直两端显示阴影.同样,当我们将方向声明为 vertical 时,它会在水平两端显示阴影.

LinearLayout has two options for orientation: horizontal & vertical. By default, if not declared, the orientation is considered as horizontal, thus showing the shadow at both the vertical ends. Similarly, when we declare orientation as vertical, it shows shadows at both the horizontal ends.

直到现在我还没有找到禁用它的方法.可能 AS 3.3 没有提供它.我仍然会尝试找到并查看是否可以禁用阴影.

I haven't found a way to disable it till now. Probably AS 3.3 does not provide it. I'll still try to find and see if I can disable shadows .

这篇关于Android Studio 在 3.3 版的布局编辑器中禁用 textview 周围的阴影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆