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.
Yes of Course, You can use it with relative layout. Use it as background of your RelativeLayout. I also used it in my project.
In all requests exists one small problem if you image will be great and smaller what size your layout, image will not resize, only repeat by X. For repeat by Y you can do it only programmly.
I solve my problem like this (set gravity fill)
drawable bg for image
and on layout
And table_cells_bg_img it's image with width=1px and height = 1px
and etc of layout, so now your image it's like background and it's will resized for any size of parent layout
Try, maybe help. To be cleared in my case i need tiled background image to full size of tablecell repeated by X coordinate (like i can do it on iOS). So i solve it like i describe.
Create an XML file named background in Drawable folder
background.xml
In your Relative Layout add the above XML as background
Yes, its possible. Define your repeating image as
Drawable (bitmap)
withandroid:tileMode="repeat"
in XML and use it as background of yourRelativeLayout
.