Fix: CSS scale breaks background properties on iOS

Resolves #2911
This commit is contained in:
Rossen Hristov
2016-10-26 15:36:37 +03:00
parent 4cc1fbd940
commit 83e0ae4c85
6 changed files with 59 additions and 3 deletions

View File

@@ -0,0 +1,18 @@
Button {
background-color: red;
background-image: url('~/ui-tests-app/image-view/gravatar2.png');
background-position: center;
background-size: 50% 50%;
background-repeat: no-repeat;
width: 100;
height: 100;
margin-bottom: 100;
}
.scale-up {
transform: scale(2, 2);
}
.scale-down {
transform: scale(0.5, 0.5);
}

View File

@@ -0,0 +1,7 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd">
<StackLayout>
<Button />
<Button class="scale-up" />
<Button class="scale-down"/>
</StackLayout>
</Page>

View File

@@ -0,0 +1,24 @@
import { EventData } from "data/observable";
import { MianPageViewModel } from "../mainPage";
import { WrapLayout } from "ui/layouts/wrap-layout";
import { Page } from "ui/page";
export function pageLoaded(args: EventData) {
let page = <Page>args.object;
let view = require("ui/core/view");
let wrapLayout = view.getViewById(page, "wrapLayoutWithExamples");
let examples: Map<string, string> = new Map<string, string>();
examples.set("2911", "issues/issue-2911");
let viewModel = new SubMianPageViewModel(wrapLayout, examples);
page.bindingContext = viewModel;
}
export class SubMianPageViewModel extends MianPageViewModel {
constructor(container: WrapLayout, examples: Map<string, string>) {
super(container, examples);
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Page loaded="pageLoaded">
<ScrollView orientation="vertical" row="1">
<WrapLayout id="wrapLayoutWithExamples"/>
</ScrollView>
</Page>

View File

@@ -37,6 +37,7 @@ export function pageLoaded(args: EventData) {
examples.set("segStyle", "segmented-bar/all");
examples.set("flexBox", "flexbox/flexbox");
examples.set("list-view", "list-view/list-view");
examples.set("issues", "issues/main-page");
//examples.set("listview_binding", "pages/listview_binding");
//examples.set("textfield", "text-field/text-field");