IPhone - how to show a view as a popup

How to show a small popup button click in the view to show in the small area of ​​the parent view.

+2


source to share


2 answers


You can simply define a frame for your view and add it as your parent's subtitle.



newView.frame = CGRectMake(60, 140, 200, 200);
[parentView addSubview:newView];

      

+5


source


Just exposing the view is pretty straightforward (create a UIView, position it and then add it to the parent). But there are a few UI design questions you can ask yourself before you come up with something. Such things as:

  • Is the popup modal? The user can then do something else, or simply "fire" the view before continuing.

  • How does a user reject a submission? Do they use the view itself, some kind of "closed" object, or touch it outward?

  • Where do you place the popup if you are too close to the window (otherwise it is clipped and the user cannot see it).

  • Do you have to compensate for this from the button itself so that the tapping finger doesn't cover the object? How many pixels work best? And does the offset make it too close to the edge, so maybe show it on the other side so it doesn't get clipped?



And they say UI design is easy ;-)

+2


source







All Articles