mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(core): add sys:// support for SF Symbol usage on images with effects (#10555)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Observable, EventData, Page, ImageSource, knownFolders, path } from '@nativescript/core';
|
||||
import { Observable, EventData, Page, ImageSource, knownFolders, path, ImageSymbolEffects } from '@nativescript/core';
|
||||
import { create, ImagePickerMediaType } from '@nativescript/imagepicker';
|
||||
|
||||
let page: Page;
|
||||
@@ -10,6 +10,10 @@ export function navigatingTo(args: EventData) {
|
||||
|
||||
export class DemoModel extends Observable {
|
||||
addingPhoto = false;
|
||||
symbolWiggleEffect: ImageSymbolEffects.Wiggle;
|
||||
symbolBounceEffect: ImageSymbolEffects.Bounce;
|
||||
symbolBreathEffect: ImageSymbolEffects.Breathe;
|
||||
symbolRotateEffect: ImageSymbolEffects.Rotate;
|
||||
|
||||
pickImage() {
|
||||
const context = create({
|
||||
|
||||
@@ -5,9 +5,27 @@
|
||||
</Page.actionBar>
|
||||
|
||||
<StackLayout class="p-20">
|
||||
|
||||
<Label text="Test Memory leaks with image picking and saving to device. Best to profile from platform IDE like Xcode." textWrap="true" />
|
||||
|
||||
<Button text="Pick and Save Image" tap="{{ pickImage }}" />
|
||||
|
||||
<ios>
|
||||
<!-- SF Symbols with Effects -->
|
||||
<ContentView height="1" width="100%" backgroundColor="#efefef" margin="10"></ContentView>
|
||||
<GridLayout rows="auto,auto,auto" columns="*,*">
|
||||
<Image src="sys://photo.on.rectangle.angled" width="100" tintColor="green" symbolEffect="{{symbolWiggleEffect}}" padding="8"/>
|
||||
<Image col="1" src="sys://steeringwheel.and.hands" width="100" tintColor="black" symbolEffect="{{symbolWiggleEffect}}" padding="8" />
|
||||
|
||||
<Image row="1" src="sys://airpods.pro.chargingcase.wireless.radiowaves.left.and.right.fill" width="100" symbolEffect="{{symbolBounceEffect}}" padding="8" />
|
||||
<Image row="1" col="1" src="sys://lungs.fill" width="100" symbolEffect="{{symbolBreathEffect}}" padding="8" />
|
||||
|
||||
|
||||
<Image row="2" src="sys://clock.arrow.trianglehead.2.counterclockwise.rotate.90" width="100" symbolEffect="{{symbolRotateEffect}}" padding="8" />
|
||||
<Image row="2" col="1" src="sys://square.and.arrow.up" width="100" symbolEffect="{{symbolWiggleEffect}}" padding="8" />
|
||||
</GridLayout>
|
||||
</ios>
|
||||
|
||||
|
||||
</StackLayout>
|
||||
</Page>
|
||||
|
||||
Reference in New Issue
Block a user