QML TextField does not show copy menu on iOS - ios

If I use default TextField control, default ios edit menu for copy/paste is displayed
TextField {
}
But I need TextField control without border, so I use TextFieldStyle
TextField {
text: value
style: TextFieldStyle {
background: Rectangle {
border.width: 0
}
}
}
In this case there is no ios edit menu fo copy/paste. Is possible to have default ios edit menu with TextField without border ?
Add: it works on iOS in Qt 5.7.0

Related

SwiftUI: How to change List selected item color

iPadOS uses a different selection color when an external keyboard is connected. But the problem is that it doesn't change the text color to white, making it difficult to read:
A simple List with NavigationLink produces this behavior by default:
var body: some View {
List {
ForEach(searchResults) { item in
NavigationLink(destination: ContentDetailView(item: item)) {
ListItemView(item: item)
}
}
}
}
I tried to improve text legibility by changing all Text colors to white when the cell is selected. But this doesn't work because the text becomes even more unreadable when no external keyboard is connected.
Is there a way to change the selection color when an external keyboard is connected? Or maybe detect when an external keyboard is connected to manually change the text color for this specific case?
You can use this line to change the selection style in the init of the View
UITableViewCell.appearance().selectionStyle = .none
And then edit the background color when the navigationLink is selected

iOS PDFKit Swift 4 , How can I make text being typed in a PDFKIT text field widget be all caps?

I am using PDFKit to manipulate an existing PDF in an iOS mobile app. I can loop through all the annotations in a PDF, but I also want to set all textfields to have caps lock on by default. So that when the user selects the text field they are able to start typing in all caps by default.
Here's part of the code:
func setAnnotationValues(_ annotations: [PDFAnnotation]){
for annotation in annotations {
annotation.font = UIFont(name: "ArialMT", size: 8)
if(annotation.widgetFieldType == .text) {
//Want to do something here to set the text to be all caps
}
}
}

After android text keyboard hided custom keyboard displayed twice

In my activity class i use both custom keyboard and android soft text keyboard. Android text soft keyboard resizes activity layout. If I open custom keyboard while soft keyboard is opened, the last one hides and layout expands back. But I open custom keyboard right after call
InputMethodManager imm = (InputMethodManager)context.GetSystemService(Context.InputMethodService);
imm.HideSoftInputFromWindow(view.WindowToken, 0);
Here view is view with custom keyboard.
And I face the problem when custom keyboard draws twice:
When android soft keyboard is hidden, but layout is not expanded back yet. In that case custom keyboard appears at the top half of the screen.
After layout is expanded back. In that case custom keyboard appears on the bottom half of the screen.
What i want to do is somehow avoid two keyboards simultaneous appearance.
In activity code i use only SoftInput.StateAlwaysHidden WindowSoftInputMode. SoftInput.AdjustPan is not convenient because in that case some views can be hidden by android keyboard.
After hours of internet search the answer has been found. Pspdfkit has great post.
And with small investigation it has been rewritten on C# in Oncreate method:
private View decorView;
private int lastVisibleDecorViewHeight = 0;
decorView = Window.DecorView;
decorView.ViewTreeObserver.GlobalLayout += (sender, args) =>
{
Rect windowVisibleDisplayFrame = new Rect();
decorView.GetWindowVisibleDisplayFrame(windowVisibleDisplayFrame);
int visibleDecorViewHeight = windowVisibleDisplayFrame.Height();
if (lastVisibleDecorViewHeight != 0)
{
if (lastVisibleDecorViewHeight > visibleDecorViewHeight)
{
OnSoftKeyboardShown();
}
else if (lastVisibleDecorViewHeight < visibleDecorViewHeight)
{
OnSoftKeyboardHidden();
if (!isAndroidSoftKeyboardShown && customKeyboardRequested)
{
Keyboard.RequestCustomKeyboard(requestedCustomKeyboardType);
customKeyboardRequested = false;
}
}
}
lastVisibleDecorViewHeight = visibleDecorViewHeight;
};
Hope this will help someone with similar problems.

dhtmlxEditor with full control buttons

When I added a dhtmlxEditor type, it shows only basic editor control button such as bold, italic, underline and erase.
ex)
{ type:"editor" , name:"notice", label:"Notice", labelWidth:600, inputWidth:600, inputHeight:279, labelLeft:25, labelTop:50, inputLeft:25, inputTop:71 }
How can I use toolbar option with full control buttons provided?
You need to add property
{ ... toolbar: true ... }

Text running off the screen in QML, Blackberry

I have a problem in Blackberry Native. The text id is a QString, and it contains many words, and I am not sure how to code it such that the text does not run off the screen. I tried LabelTextFitMode and it doesn't work. Any ideas?
Label {
text: "Description:"
textStyle.fontWeight: FontWeight.Normal
textStyle.fontSize: FontSize.Small
textStyle.color: Color.DarkRed // Show this text
}
Label {
id: description // Name this as type_label so that the property alias above can set the text property of this item
//textStyle.fontSize: FontSize.Small
textFit {
mode: LabelTextFitMode.FitToBounds
}
}
Just use multiline like this:
Label {
id: description
multiline: true
}

Resources