mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
8
apps/app/ui-tests-app/css/label-background-image.css
Normal file
8
apps/app/ui-tests-app/css/label-background-image.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Label {
|
||||||
|
background-image: url('~/ui-tests-app/pages/test2.png');
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: left;
|
||||||
|
background-size: contain;
|
||||||
|
margin: 10;
|
||||||
|
border-width: 1;
|
||||||
|
}
|
7
apps/app/ui-tests-app/css/label-background-image.xml
Normal file
7
apps/app/ui-tests-app/css/label-background-image.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<Page>
|
||||||
|
<StackLayout>
|
||||||
|
<Label text="Label1"/>
|
||||||
|
<Label text="Label2" width="150" height="200" />
|
||||||
|
<Label text="Label3" width="200" height="150"/>
|
||||||
|
</StackLayout>
|
||||||
|
</Page>
|
@ -24,6 +24,7 @@ export function pageLoaded(args: EventData) {
|
|||||||
examples.set("zindex", "css/zindex");
|
examples.set("zindex", "css/zindex");
|
||||||
examples.set("clipPath", "css/clip-path");
|
examples.set("clipPath", "css/clip-path");
|
||||||
examples.set("padding", "css/padding");
|
examples.set("padding", "css/padding");
|
||||||
|
examples.set("label-background-image", "css/label-background-image");
|
||||||
|
|
||||||
let viewModel = new SubMianPageViewModel(wrapLayout, examples);
|
let viewModel = new SubMianPageViewModel(wrapLayout, examples);
|
||||||
page.bindingContext = viewModel;
|
page.bindingContext = viewModel;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<!-- WebView: local and string -->
|
<!-- WebView: local and string -->
|
||||||
<WebView src="~/ui-tests-app/web-view/test.html" height="50" />
|
<WebView src="~/ui-tests-app/web-view/test.html" height="50" />
|
||||||
<WebView src="<html><body><img src='./pages/test2.png'></img></body></html>" height="75" />
|
<WebView src="<html><body><img src='./ui-tests-app/pages/test2.png'></img></body></html>" height="75" />
|
||||||
|
|
||||||
<!-- Resources: png and jpg -->
|
<!-- Resources: png and jpg -->
|
||||||
<WrapLayout>
|
<WrapLayout>
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"version": "2.1.1"
|
"version": "2.1.1"
|
||||||
},
|
},
|
||||||
"tns-ios": {
|
"tns-ios": {
|
||||||
"version": "2.1.0"
|
"version": "2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -94,7 +94,7 @@ export module ios {
|
|||||||
UIGraphicsBeginImageContextWithOptions(originalImage.size, false, 0.0);
|
UIGraphicsBeginImageContextWithOptions(originalImage.size, false, 0.0);
|
||||||
var context = UIGraphicsGetCurrentContext();
|
var context = UIGraphicsGetCurrentContext();
|
||||||
CGContextSaveGState(context);
|
CGContextSaveGState(context);
|
||||||
CGContextTranslateCTM(context, 0.0, originalImage.size.width);
|
CGContextTranslateCTM(context, 0.0, originalImage.size.height);
|
||||||
CGContextScaleCTM(context, 1.0, -1.0);
|
CGContextScaleCTM(context, 1.0, -1.0);
|
||||||
originalImage.drawInRect(CGRectMake(0, 0, originalImage.size.width, originalImage.size.height))
|
originalImage.drawInRect(CGRectMake(0, 0, originalImage.size.width, originalImage.size.height))
|
||||||
CGContextRestoreGState(context);
|
CGContextRestoreGState(context);
|
||||||
|
Reference in New Issue
Block a user