How to set this Layout in iPhone need Some help

前端 未结 1 1654
耶瑟儿~
耶瑟儿~ 2021-01-22 04:19

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

<
相关标签:
1条回答
  • 2021-01-22 04:24

    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 讨论(0)
提交回复
热议问题