gpt4 book ai didi

android - 如何删除布局上的边框

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:23:03 24 4
gpt4 key购买 nike

您好,我想这样做: enter image description here

还有我的解决方案

线性布局的这个设置角:drawable/draw_arc_corner_shape

<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >

<solid
android:color="@color/bg_trip_tab_view" >
</solid>

<!--<stroke-->
<!--android:width="0dp"-->
<!--android:color="@color/bg_trip_tab_view" >-->
<!--</stroke>-->

<padding
android:left="0dp"
android:top="5dp"
android:right="0dp"
android:bottom="5dp" >
</padding>

<corners
android:radius="11dp" >
</corners>

这部分dwaw圈:drawable/draw_circle_shape

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval"
android:useLevel="false" >
<solid android:color="@color/bg_my_trip_tab_view" />
<size
android:height="10dp"
android:width="10dp" />
</shape>

这条画虚线:drawable/draw_dash_line_shape

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line" >
<stroke
android:dashGap="3dp"
android:dashWidth="2dp"
android:width="1dp"
android:color="@color/bg_my_trip_tab_view" />
</shape>

并在此处创建 View (分隔符),在开始和结束时使用圆圈(半圆)和虚线:layout/separator

<?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="match_parent"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_alignParentBottom="true">

<View
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginLeft="-10dp"
android:background="@drawable/draw_circle_shape"
/>

<View
android:layout_width="0dp"
android:layout_height="5dp"
android:background="@drawable/draw_dash_line_shape"
android:layerType="software"
android:layout_weight="1"
android:paddingRight="15dp"
/>

<View
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_marginRight="-10dp"
android:background="@drawable/draw_circle_shape"
/>
</LinearLayout>

我在这里使用它:layout/main_screen

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/bg_my_trip_tab_view"
>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/draw_arc_corner_shape"
>
<include
android:layout_marginTop="@dimen/grid_20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/separator"

/>
</LinearLayout>

这是我的结果: enter image description here

还有我的问题:如何删除带阴影的边框?我怎样才能做得更好?

最佳答案

您是否在 Android Studio xml 设计 View 中获得边框阴影。在真实设备上没有阴影显示。

关于android - 如何删除布局上的边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38913108/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com