I have set-up in a storyboard a view that contents two textfields: one with secure option turn on and an other without.
I have set-up the content of those textfields in the viewDidLoad method of the associated viewController. If I select the textField with secure note turned on then select the other one and click the backspace all its content of this latter gets clear out. It is not happening if I select directly the textfield with no secure option the first time.
Does anyone have a clue of this behaviour?
It looks like this is a bug that appeared on iOS6 and related to changes introduce with UITextField where other people have also observed changes in behavior between iOS5 and iOS6; see this post: (Backspace functionality in iOS 6 & iOS 5 for UITextfield with 'secure' attribute)
Related
How can I prevent the showing of the Next or Done buttons of the Android VKB in a Codename One app?
Currently, for my app, they are a mess: the next button of the VKB doesn't focus the next field, but the previous. After tons of trials, I didn't find a way to make them working correctly (but there are fine on iOS and on the Simulator). I also tried to override the Layout.overridesTabIndices(com.codename1.ui.Container) and Layout.getChildrenInTraversalOrder(com.codename1.ui.Container) methods in the Form, but nothing changed on Android.
I supposed two possible causes: the use of a Form inside a Form or, more probably, the fact that I replace all the TextFields and Pickers in the same Form (and other components). Maybe the fact that the inner Form is deeply changed results in a confusion for the Android mapping of the "next" button.
That's why my request: because I didn't find a way to make the "next" button useful, I'm asking how I can avoid that it's been shown.
Thank you
Nesting forms would probably mess with the focus traversal/tab order.
Normally you should be able to override public TabIterator getTabIterator(Component start) to return a blank iterator. I'd suggest doing the same for both the parent and child form to disable the "next" feature.
When putting i.e. a
TextField textField = new TextField("π½πΆπΆ");
on a form it works perfect on Android but on iOS it gets garbled.
To reproduce:
show the form -> textfield looks it correct
focus it for edit on it by clicking
change nothing, just select done / loose focus
focus it again for edit on it by clicking
The result are strange symbols.
textField.getText().getBytes() - on iOS gives the bytes: -16,-97,-105,-67, ... before the edit (the same sequence as on Android or in the simulator), but -17,-105,-67,-17, ... after ending "edit" (without editing).
It seems that a 4 byte code -16,-97,-114,-74 for the πΆ gets a 3 byte code -17,-114,-74 after editing.
I would strongly suggest avoiding emoji's in the code itself. This is an issue with our implementation of the iOS UTF-8 parser that was resolved recently: https://github.com/codenameone/CodenameOne/issues/2365
However, it didn't make it into the 4.0 release so this should work within a couple of weeks when we resume the weekly updates.
In a test-class, is there any way to invoke Buttons inside the toolbar, without a name (""), which were added like this?
getToolbar().addMaterialCommandToRightBar("", FontImage.MATERIAL_PICTURE_AS_PDF, e -> createPDF());
Or can I somehow tell the test-class to show a specific form ?(which is happening when I click the button without a label).
The test recorder is not generating any code in that case. It seems that it is only working with buttons, which have a non-empty String as name, as they are simply invoked by
clickButtonByLabel("Label");
The test recorder was written before the Toolbar existed, we tried to update it for the Toolbar recently but this proved to be pretty difficult.
We have this issue that covers this bug. As a workaround you can post the command directly in the code of the test.
I think I found a little iOS 7 bug..
If you have a static table view as a part of a navigation view controller and the user use the swipe back gesture to get one level back, the selection highlight doesn't dismiss!
(if the user press the back navigation bar button the selection dismiss normal)
Does anybody also detect this bug?
Does anybody has a fix for that?
Thank you a lot
A quick fix for this could be:
[tableView deselectRowAtIndexPath:[tableView indexPathForSelectedRow] animated:YES];
inside the viewDidAppear method. (not tested)
I have integrated QLPreviewController and UIDocumentInteractionController in my app, and it is working fine.
The only problem is- I want to configure the bottom toolbar, I want to remove the default toolbar items, which appear as shown in image below:
Is there any way to do so, please suggest.
Short Answer: NO, Not in IOS6+
Description:
One thing to note about QLPreviewController is that it's not meant to be customized. There were other libraries allowing you to change the functionality such as:
https://github.com/rob-brown/RBFilePreviewer
Which are not working in iOS 6+ since apple made a big change in QLPreviewController and it's technically running in a separate process. Although it might be possible (not sure) using private apis but your app will be rejected then.
You can find more info about this change here:
http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/
Hope this helps
Subclass UIToolbar
Create UINavigationController using
init(navigationBarClass:toolbarClass:) and supply UIToolbar subsclass created in step 1 for toolbarClass
Create QLPreviewController instance and push onto UINavigationController stack
Inside of UIToolbar subsclass override
setItems(_:animated:). To remove all buttons call super with empty array super.setItems([], animated: false) or potentially you can add only buttons you want to keep.
Present UINavigationController created in step 2
Here is the example PreviewControllerHideBottomButtons
Subclass QLPreviewController.
Search for the Toolbar in the view hierarchy.
Have a UIToolbar property in your class that has the same frame as the original toolbar.
Place your own toolbar above the default one with whatever buttons you want.
If you want it to be hidden as the default behavior of the QLPreviewController you can key value observe the hidden property of the default toolbar and present / hide your own accordingly.