ios - UIButton positioned where half is in the air-is disabled? -
i have side uiview
in screen size . side uiview
, placed on left x
@ -screen.width
, dont see him .
than , in side view class view, adding little square uiview, @ right , @ screen.width
, means on main view can see on left , little square side view .
this construction side menu effect .
in little square view, there uibutton
, but button not responding touches .
i not want place side menu few pixels within screen, because may cover content .
hence, created construction side menu in screen size,it placed on minus screen size.width
and has little square comes screen ,and when force it, whole side view comes in .
why button disabled ? is because hang in air, part of not within superview ?
edit:
found great reply not working me
interaction beyond bounds of uiview
i have added parent view contains button , , log touch,but not working.
- (uiview *)hittest:(cgpoint)point withevent:(uievent *)event { cgfloat radius = 200.0; cgrect frame = cgrectmake(self.frame.size.width, 0, radius, radius); if (cgrectcontainspoint(frame, point)) { nslog(@"log"); homecoming self; } homecoming nil; } - (bool)pointinside:(cgpoint)point withevent:(uievent *)event { if (cgrectcontainspoint(self.bounds, point) || cgrectcontainspoint(menus.frame, point)) { homecoming yes; } homecoming no; }
thanks aaron , found indeed solution works :
interaction beyond bounds of uiview
but found improve way side menu without covering content of main screen, set height of side menu small, , set x appear little bit within main scene.
than when open it, moment before bringing cover main scene, alter height in screen height , way ,you dont cover content when menu closed, when open alter height total height .
hope can help .
ios objective-c uiview
No comments:
Post a Comment