Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Keyboard ui button.
-
I'm a little greedy, but is it possible to use the following programs mixed?
import ui from objc_util import * def NextFieldKeyInTextFieldKeyboard(view, button, background_color='lightgray'): # parameters: view = main view of textfields # button = ui.Button designed by user (size, title, image...) # background_color = background_color of InputAccessoryView # create ui.View for InputAccessoryView above keyboard v = ui.View() # view above keyboard v.background_color = background_color # background_color of user choice v.width = ui.get_screen_size()[0] # width of screen, thus of keyboard v.height = button.height + 4 # only for Next button # code executed when Next key is tapped def Next_tapped(sender): s = sender.objc_instance.firstResponder()._nextKeyResponder().becomeFirstResponder() button.action = Next_tapped # code to be executed if button tapped v.add_subview(button) # set as subview of view vo = ObjCInstance(v) # get ObjectiveC object of v # attach to each textfield an InputAccessoryView abobe the keyboard for sv in view.subviews: # loop on all subviews of main view if 'TextField' in str(type(sv)): # subview is a TextField tfo = ObjCInstance(sv).textField()# get ObjectiveC object of sv tfo.setInputAccessoryView_(vo) # attach our accessory to textfield if __name__ == '__main__': main_view = ui.View() main_view.name = 'NextFieldKeyInTextFieldKeyboard' main_view.frame = (0,0,380,140) main_view.add_subview(ui.TextField(frame=(10, 2,360,32))) main_view.add_subview(ui.TextField(frame=(10, 36,360,32))) main_view.add_subview(ui.TextField(frame=(10, 70,360,32))) main_view.add_subview(ui.TextField(frame=(10,104,360,32))) button = ui.Button() # Button for Next key button.frame = (0,0,32,32) button.font = ('<System-Bold>',24) button.title = '⏯' # emoji as title NextFieldKeyInTextFieldKeyboard(main_view,button)#,background_color='green') main_view.present('sheet')
-
If possible, I would like to edit multiple Text views.
-
@shinya.ta Just to be sure: multiple TextViews but with buttons only once?
Button should process on TextView where the cursor is? Please confirm before I begin. Thanks -
@shinya.ta Could you try/test this version and give me your feedback, thanks
script with multiple TextViews -
Dear.cvp
Wonderful. I was looking for this.
It's perfect.You are God.
Thank you very much.
Thank you very much. -
@shinya.ta Hello, I'm happy it's ok for you, but, believe me, I'm very far to be a god of Python, or even of anything else, like my wife says 😂
-
Dear.cvp
Finally, there was one problem.
Even though the speech is written, they don't read the letters.Is there any problem?
-
I haven't checked the iPad yet, but the Emoji task bar doesn't show it on the iPhone.
-
@shinya.ta the button Next Emojis will not appear on iPad.
see Apple docBut it should appear in the emojis rows.
-
@shinya.ta You were right, I had a bug for an iPhone, I'm sorry, sincerely
About the speech problem, is this one occurring since your update?
-
The Emoji task bar was displayed on iPhone, too.
I didn't speak the speech on the iPhone.
I speak properly with iPad. -
@shinya.ta You have to check of your general settings are the same on your iPad and your iPhone
-
How can I confirm that?
-
@shinya.ta check one y one your settings in general/accessibility
-
I checked the accessibility.
But all of them were set in the same way.My wife's iPhone has a home button. There is a home button on iPad, too.
But mine is iPhone XS Max, so there is no home button.Is it because of the difference in the device?
-
@shinya.ta Sorry but I don't know that. Hoping somebody else in the forum could help you