I have a people picker inside a UIPopoverController, since it has a search field, which will trigger the keyboard when tapped, then I got this ugly result:
the arrow of the popover is UP which is best look in my app, I also tried to use UP | DOWN but it does not work(still always UP), I know I can use only DOWN arrow instead, but that should be the last solution, I wonder is there any method to deal with this?
Thanks!
update:
I was thinking that can I use UP arrow first, then when the search field becomes first responds(not sure how to detect this), I change it to DOWN arrow(also not sure how to do this)?
update 2:
also the view is not a table or something that can be scrolled, so I cannot scroll the view to make the popover look fine.
You are right, that is quite an ugly resolution.
The problem is that the UIPopoverController is coded to avoid colling with the keyboard view.
I think the only way you can work around this is to either create a custom UIPopoverController that ignores the keyboard appearing (i believe some listeners needs to be disabled on either the SharedApplication or mainscreen) or make a custom UIView that holds this.
Related
I am trying to figure out how to keep the textfield about the keyboard in IOS. I tried the different code on stackoverflow but none works perfectly. Like if the textfield is above the keyboard and I click on the field, it does not move up. How can I show the textfield above the keyboard at all times? thanks!
lakesh's link is an excellent resource to look at.
There are essentially two ways to handle the situation.
Method 1:
You can encapsulate your view inside a UIScrollView and when the keyboard pops up, you should scroll your entire view up an equal distance to account for the space taken up by the keyboard.
Method 2:
Take the ultimate parent UIView inside your current UIViewController and change its frame (ideally with an animation) so that it moves off the top of the screen and makes way for the keyboard.
As a general guide, Method 1 is the preferred method. This is because you can still access the UI 'higher up' in the UIScrollView by scrolling up to it (consider say, a form with multiple fields). In Method 2 the user cannot return to the other elements in the view without the keyboard first being dismissed. Of course, it may be that you don't need to see the rest of the view while accepting keyboard input, but that decision is up to you.
I am making an app. It is kind of a hide and go seek. I was thinking about sectioning off separate areas and having the app say something different as to where you touched the screen. It will give you clues to where on the screen you need to touch next. So, these are my questions:
What is the easiest way? Would I want to make a grid of roundrectbuttons-placing each one and making an outlet for each - or can I make grid of buttons some other on the screen.If I place each button I will have a 9x12 of buttons making 108 buttons. Then I need to have a way to choose a random button as to where the location of the thing is question is. Would I use buttons at all or is there an easier way?
108 buttons is far too many to place in a xib :) If you wanted to use buttons then I would create them programatically in viewDidLoad in your controller.
Hoewever, I wouldn't use buttons at all!
I would use a TapGestureRecognizer attached to your background view. When you recieve a tap, take a look at where it was (use locationInView:self.view) and use that to work out what to do with the press.
This is hard for me to explain, so please bear with me for a minute.
In Xcode, if it is in full screen mode, showing the app's menu also moves the toolbar down. I have tried to make an NSView move and resize whenever the menu bar is shown, but I cannot figure out how to do it. I think this has something to do with and event, because setting struts and springs in Xcode does not make it move automatically. Can anybody help me figure out what the event is?
Edit: I just re-thought my question, and I have to make a correction. NSToolbar does this on it's own. I want a normal NSView to move and resize itself when the window goes into full screen mode.
I think you might be having the same issue as I was - if so, you need to call [NSToolbar setFullScreenAccessoryView:] on the "accessory view" you want to glue to the bottom of the NSToolbar.
Note that in windowed mode, your accessory view should take up space in the NSWindow's contentView just like any other view, but when you enter fullscreen mode you'll want to remove the accessory view somehow since Cocoa rips it out of your layout and leaves a gap unless you account for that.
I can certainly understand this issue being difficult to explain without having the background knowledge - I had the same problem. :)
Also see: How can I get a two-row toolbar like in Mail.app and Xcode?
Before I start I should say I know this seems like a long shot, however I figured it was worth a try.
One app I am working on right now is a Mac Statusbar App. It has a NSStatusItem in the menubar and when clicked it will display a custom window with a popover appearance (like on iPad or like Fantastical has on the mac.) Anyway I started testing this by inserting a single nsmenu item in the status items menu. The view has set clear color for the background color on its window. However this still doesn't quite work as you can see in the pic below
There is still a small white thin line above and below the item
The clear area isn't clear, its like it has a blur filter on it
Other than that, it works fantastically great. I just didn't know if anybody else has ever attempted anything like this before and figured out how to overcome these 2 issues which seem to be the only thing preventing this from working.
If there is no way to do this I may have to resort to using a custom view for the NSStatusItem so I can get the coordinates on screen to position my own window below the NSStatusItem.
A fake window seems like a rather weird approach to this. Why not just pop up a regular window? I suggest MAAttachedWindow: http://mattgemmell.com/2007/10/03/maattachedwindow-nswindow-subclass
I'm working with Xcode doing a Ipad app.
i simply want user to click anywhere on screen (not counting text fields) to perform some IBAction.I'm using an invisible button that covers my whole view.
Since I have some text fields in my view,i need to add this invisible button to the background of my user interface. I cant seem to find this option in the button attributes? any help?
Just set the button's type to custom.
Did you try setting the opacity of the button to zero?
I guess i got your point. You just want to put the UIButton(invisible) on the back of all the UITextField. The simple solution to this is open the Document Window in the IB. Now expand the view tree in the list view. Just drag your UIButton above the UITextFields and set the alpha value for the button in the property to be zero.
Hope this helps!!
iPad users don't "click". They "tap" or "touch".
In Interface Builder, I believe views are constructed with a z-index from top to bottom as they appear in the document window, so dragging your button so that it appears as the first subview of your main view should be a quick fix for this.
Have you considered other approaches? This doesn't sound like standard behaviour for an app and will probably cause havoc with anybody using Voice Over. What are you trying to accomplish?