在RelativeLayout 中使用ImageView 重复Image [英] Repeat Image in with ImageView in RelativeLayout

查看:26
本文介绍了在RelativeLayout 中使用ImageView 重复Image的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 RelativeLayout 中使用 ImageView 重复图像.是否可以使用位图 xml 并使用 tilemode "repeat"RelativeLayout,因为我在 Internet 上看到的东西都处理 LinearLayout.

I want to repeat the image with ImageView with in RelativeLayout. Can it be possible to use the Bitmap xml and use tilemode "repeat" with RelativeLayout, because what I have seen things on Internet they all dealing with LinearLayout.

我们将热烈欢迎任何帮助或提示.

Any help or tip will be warmly welcomed.

推荐答案

Drawable 文件夹中创建一个名为 background 的 XML 文件

Create an XML file named background in Drawable folder

background.xml

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/imagename"
android:tileMode="repeat" />

在您的相对布局中添加上述 XML 作为背景

In your Relative Layout add the above XML as background

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:background="@drawable/background" />

这篇关于在RelativeLayout 中使用ImageView 重复Image的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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