mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(ios): apple intelligence writing tools (#10643)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Page, Observable, EventData, TextField, PropertyChangeData } from '@nativescript/core';
|
||||
import { Page, Observable, EventData, TextField, PropertyChangeData, TextView } from '@nativescript/core';
|
||||
|
||||
let page: Page;
|
||||
|
||||
@@ -28,6 +28,12 @@ export class SampleData extends Observable {
|
||||
console.log(args.value);
|
||||
this.notifyPropertyChange('formattedPhoneInput', args.value);
|
||||
}
|
||||
|
||||
textChangeArea(args: PropertyChangeData) {
|
||||
const textArea = args.object as TextView;
|
||||
console.log('---- AI active:', textArea.isWritingToolsActive);
|
||||
console.log('textChangeArea:', args.value);
|
||||
}
|
||||
}
|
||||
|
||||
function formatPhoneNumber(value: string, useParens?: boolean) {
|
||||
|
||||
@@ -20,6 +20,10 @@
|
||||
</TextField>
|
||||
<Label text="{{ formattedPhoneInput }}" marginTop="6" />
|
||||
|
||||
<Label text="TextView" fontWeight="bold" marginTop="12" />
|
||||
<TextView hint="Type text..." style.placeholderColor="silver" textChange="{{textChangeArea}}" color="black" width="80%" borderColor="silver" borderWidth="1" height="200" borderRadius="4" fontSize="14">
|
||||
</TextView>
|
||||
|
||||
</StackLayout>
|
||||
</ScrollView>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user