I made my own keyboard by buttons and I want to never show the Apple keyboard even by touching the text field? How is that done?
Set your custom keyboard view as the inputView of the textfield.
textField.inputView = customView
Then the keyboard will show with your custom view. And you get all the animations and stuff for free.
If you don't want your custom view in the iOS keyboard you might need to check out something like what this guy explains in this SO answer
Related
I have a SwiftUI Form with a Section that contains a DatePicker. The DatePicker is set to have a datePickerStyle of CompactDatePickerStyle(), by default, since it's in a Form.
When tapping on the DatePicker, the overlay is presented:
The DatePicker's time is able to be modified by using a gesture, as seen in the following video:
In the following video, tapping on the overlaid DatePicker's time to modify it via the keyboard causes the overlay to be dismissed:
I have also tried adding the following to the DatePicker in order to allow for inline date manipulation, hoping for keyboard avoidance:
.datePickerStyle(GraphicalDatePickerStyle())
.ignoresSafeArea(.keyboard, edges: .bottom)
However, the above results in the following:
What do I need to change to allow the DatePicker to be manipulated via gestures and keyboard input within the form?
You need to raise the datepicker so the keyboard wouldn't show over the datepicker, already reported this bug in October 2020 and the ticket is still open. These datepicker don't have keyboard avoidance. Also found an issue with GraphicalDatePickerStyle that can crash the app, ticket still open too.
Did you try to use .ignoresSafeArea(.keyboard) on the entire Form? I had the same issue and this fixed it for me.
I'm trying to implement a footnote along with couple of buttons inside the footer.
Card card1.setFootnote("Footer");
Button btnSave = new Button(this)
Button btnClear = new Button(this)
card1.setButton(btnSave); //no option to put into card at footer
card1.setButton(btnClear); //no option to put into card at footer
How could I do this?
While you could modify the view hierarchy that gets returned by Card.toView() to insert whatever widgets you want, consider that this isn't the best approach for user interaction. Since Glass does not provide a touch screen, Button widgets make little sense on that form factor.
A better approach would be to add an options menu with your actions that would be presented when the user taps on the touchpad.
If you really want to do that Rakesk then i suggest you design your layout in landscape using xml. Size of that layout should be relative to 640 x 480 resolution. In this way you can add as many widgets in the UI as you want though it is not recommended.
I have an application using UITabBarController. There are 5 tabs (tab1, tab2, cameraTab, tab3, tab4). When user taps on middle tab , the modal view will appear hiding the TabBar (in my case camera - UIImagePickerController). If user then taps on cancel button on that modal view, how do I make it to return to previously selected tab. For example: if i am on tab2 and I tap on the camera tab, modal view appears and then I tap on cancel, how do i return back to tab2 automatically. The same goes for all other tabs, if I'm on tab3 it should return to tab 3 and so on. Right now it remains on camera tab without modal view - just blank view with background image.
I'd really appreciate if you can help me with some examples. I've been searching in various ways - there must be a way that UITabBarController keeps a record of previously selected tab.
Thank you
Personally, I think you should create a custom view where the middle camera tab would not be a tab at all, it would actually just be a button that presents the modal view and then that view would have a button to dismiss it. I would do a little research in http://idevrecipes.com/ to see if there is anything there. If not, maybe github. The tab bar itself is looking for views to push, not present.
I am sorry I couldn't give you more of an answer, but I wanted to give you something for waiting so long.
As documented:
"If not all tabs can be shown at once, the tab control displays an up-down control so that the user can scroll additional tabs into view."
http://msdn.microsoft.com/en-us/library/bb760550%28VS.85%29.aspx
I don't want this. I don't want an up down control to show if I have too many and I don't want multiline tabs. I want a single strip. I will handle the case of too many tabs with a control I create myself, but I don't want the up-down control. Thanks
There's no style for that, so i believe the only way is a bit of hacking. From what i can see with my Spy++, the updown control is a true child control of the tab control with id = 1. So, you can actually hide it with ShowWindow().
Can anyone explain how to add dropdown arrows to CMFCToolBar toolbar buttons - like for undo/redo buttons. We had this with CToolBar by using the TBSTYLE_EX_DRAWDDARROWS style and TBN_DROPDOWN notification. This doesn't seem to work with CMFCToolBar. These dropdown arrows i believe are added to the VisualStudioDemo MFC feature pack demo but i can not figure out how.
In the VisualStudioDemo sample, in CMainFrame::OnToolbarReset they replace the Undo button of the toolbar with a custom class called CUndoButton, like this:
m_wndToolBar.ReplaceButton(ID_EDIT_UNDO, CUndoButton(ID_EDIT_UNDO, _T("&Undo")));
CUndoButton is declared in file "UndoBar.h" of the sample project, so you can use it or change it however you like.