开发者

How to set this Layout in iPhone need Some help

I have Implement Some paint like application. For that the Layout is like as below:

How to set this Layout in iPhone need Some help

Here, there is One View and two buttons. In My application i am selecting the colour from Button2 and then doing drawing on View. But the Problem is while i am selecting the Colour and if i do the Paint on the View, all works file but if that paint come over the Button1, it also paint on that button1. I wan开发者_开发技巧t set as like that the selection colour Should not be paint on the Button1 and only paint on the View. So for that What Should i have to do ? I want to set the Button1 in front of the View and do not allow to paint on it. please Guide me proper regarding this mater. Thanks.


You have to make sure your buttons are not subviews of the view you are drawing in.

The simplest way to do this is to organize your buttons and your view in interface builder so that you have a UIView within your window as well as your buttons which must be on a higher layer than your UIView but cannot be inside your UIView. I would post pictures if the site would let me. You will then need to make a UIView IBOutlet to attatch to the UIView in Interface Builder and to draw to in your code.

To do this programmatically, after you have created your buttons, create a UIView and add it as a subview to your viewController's view by using (if myView is your UIView)

[self.view addSubview:myView] 

and then use

[self.view send SubviewToBack:myView]

to make sure it is behind your other subviews (your buttons). Draw to myView and it should appear behind the buttons.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜