Xavi Valero
Xavi Valero

Reputation: 2057

Setting 2 different backgrounds for a view

I have a view, which is divided into 2 parts. On the top half of the view I want a blue background and on the bottom half I want a transparent background. I am not sure if it can be done. Any suggestions will be appreciated. Thanks

Upvotes: 0

Views: 98

Answers (2)

XJones
XJones

Reputation: 21967

There are multiple ways to do this. By far the easiest is to simply create a subview in the top half of the view with a blue background. Other methods include adding a sublayer or overriding drawRect with custom drawing code.

Upvotes: 1

IPaPa
IPaPa

Reputation: 468

if you only want to create a single view then you have to create a image file with 2 parts

upper part is blue and bottom half is transparent

else you need to create two view with different background

Upvotes: 0

Related Questions