android - 如何绘制带状线作为背景

标签 android background android-imageview

有没有办法在android中绘制“带状线”作为背景?


附有图片以便更好地说明:(Youtube 应用程序)

enter image description here

最佳答案

示例:

wood_pattern.xml 添加到 res/drawable/ :

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <bitmap
                android:src="@drawable/bg_wood"
                android:tileMode="repeat"
                android:dither="true"
                android:antialias="true"/>
    </item>
</layer-list>

将其设置为背景:

android:background="@drawable/wood_pattern"

关于android - 如何绘制带状线作为背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17247278/

相关文章:

android - 基于 X 轴裁剪图像以适合 ImageView

android - 数据库未将数据从一项 Activity 更新到另一项 Activity

android - Flow 不更新 Composable

CSS:IE:样式版本 "background-color:rgba(...)"

Android:将一张图片放在另一张图片上

java - 在回调监听器中设置 imageview 位图

java - 找不到类,未找到类定义

java - 屏幕旋转时不保存当前Fragment和数据

permissions - 有没有办法在iOS13中主动触发.always coreLocation权限?

html - 如何在 Notepad++ 中查找/替换通配符搜索的一部分