I am having a TextField in qml layout, while enabling the keyboard the first TextField is showing and below all the TextField is hiding. How do I solve this issue?
Here is the solution
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Vertical
}
}
Add all your views inside a ScrollView. You'll then be able to scroll up to the unreachables items.
Related
In my view I have two text fields and one text view. The text fields aren't hidden by the keyboard but the text view is. No problem. I can scroll it. The issue I'm having is that if the keyboard is already visible the keyboardWillBeShown event doesn't occur. My text view is visible enough to be tapped on when the keyboard is up but I want the entire field to scroll into view. Since keyboardWillBeShown won't fire (since the keyboard is already shown) how can I scroll the field?
I figured it out. Just had to add the scrolling code to the begin editing event.
I have a view controller with 8 text fields placed vertically in the view. The problem is that the keyboard obstructs some of the text fields so that the user cannot enter any data. So, basically I need a way to scroll the view.
I did try following the approach listed in this StackOverflow question but had trouble converting some of the objective-c to Swift.
How to make the view controller scroll to text field when keyboard appears
I was wondering if anyone has solved this problem in Swift and if so could post an example?
Thanks in advance!
Hi I've resolved this problem through subclassing UIScrollView. This is a swift version of scrollView and it works with auto layout.
You can checkout here https://github.com/honghaoz/AutoKeyboardScrollView
Basically, the idea is registering keyboard notifications (e.g. UIKeyboardWillChangeFrameNotification), and scroll to let active textFields visible when keyboarding is showing.
Is it possible add keyboard in action sheet?
If yes, how can I do? ... I would like to disable the background.
Thanks, Luigi.
I think UIKeyBoard can not be added in ActionSheet but you achieve your goal but handling keyboard notifications...add the Keyboard will appear and will disappear notifications in your controller...
on keyboard will appear add a subview of frame same as the parent view frame..and set its alpha 0.5...it will look like An ActionSheet is appearing and the background will automatically be disabled and on keyboard disappear remove that view from superview...you can add tap Gesture in the view you are adding..Hope so it will be answer of your question.
You can add different controls to action sheets, like pickers and text views. However, as mentioned you can't add a keyboard.
If you want to customize what is shown when the keyboard is shown, you can slide controls with the keyboard, to make it look like they are part of the keyboard.
Alternatively you could create your own keyboard using buttons etc.
i have a TableView with custom cells that i have built with Interface Builder.
Inside the cell, i have a label and a text field. But when i click on the text field to write, the keyboard overlaps the text field and i can't see what i am writing.
How can i avoid this?
Thanks
You have to resize the view containing the tableview when keyboard is shown. The way you can do is discussed here,
How to make a UITextField move up when keyboard is present?
You can search in Stackoverflow more on 'iphone keyboard hides textview'.
after resizing view, you can scroll table to the current cell too.
How can I get a textview to be able to scroll without the keyboard poping up for edit when clicked on? I am pretty new to iPhone programming and I've tried several different combinations in Interface Builder, but can't seem to get any to work. Also I am having trouble when I have two textviews on the screen where only one of them will scroll. Any help would be greatly appreciated.Thanks!
textView.editable=NO;
it is a property of UITextview, check the documentation
cheers
In IB, next to the "Text Color" box, untick the 'Editable' checkbox.
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView{
return NO;
}
try to implement this UITextView's delegate method.