Pixate background-image no-repeat?

379 Views Asked by At

I am trying to put a background image into a text-field (it's just a search icon). And it is tiling the image in the text field. Is it possible to turn off the repeating of the image? i don't see anything like that, i'm seeing padding and position for background images but nothing to turn off the tiling of the image. is this not possible in pixate yet?

thanks!

2

There are 2 best solutions below

1
On

You should be able to set background-size to the size of your text-field so it won't have anything to repeat.

0
On

I battled this same problem, and in the end, I found I got what I wanted by using multiple objects. Even if you get the search icon to work right, you're probably going to notice the UITextField doesn't pad the text away from the icon.

Anyway, here's how I ended up doing it so that I had full control over the style.

enter image description here

So you can put your search icon in the UIImageView and then define your text field's style (border, background color, etc.) with the UIView. The UITextField ends up being plain white/transparent, and positioned so that its text doesn't overrun the search icon.

I hope that helps.