Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ apps/lib/
apps/hooks/
apps/node_modules/

package-lock.json
package-lock.json

.nsbuildinfo
1 change: 1 addition & 0 deletions apps/app/ui-tests-app/list-view/main-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export function loadExamples() {
examples.set("bindings", "list-view/listview-binding");
examples.set("listview-bg-separator-color", "list-view/listview-bg-separator-color");
examples.set("csslv", "list-view/csslv");
examples.set("scrolling-and-sizing", "list-view/scrolling-and-sizing");

return examples;
}
47 changes: 47 additions & 0 deletions apps/app/ui-tests-app/list-view/scrolling-and-sizing.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.p-10 {
padding: 10 20 10 20;
}

.m-b-10 {
margin-bottom: 10;
}

.page {
background-color: #F2F2F2;
}

TextView {
background-color: #FFF;
}

.bordered {
border-width: 5;
border-color: green;
}

.fixed-height {
height: 55;
}

.border-radius {
border-radius: 15;
}

.border-radius-nonuniform {
border-radius: 10 20 30 40;
}

.bordered-nonuniform {
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: purple;
border-top-width: 5;
border-right-width: 10;
border-bottom-width: 15;
border-left-width: 20;
}

.body {
font-size: 11;
}
4 changes: 4 additions & 0 deletions apps/app/ui-tests-app/list-view/scrolling-and-sizing.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export function onNavigatingTo(args) {
const page = args.object;
page.bindingContext = ["The quick", "brown fox", "jumped over", "the", "lazy dog."];
}
55 changes: 55 additions & 0 deletions apps/app/ui-tests-app/list-view/scrolling-and-sizing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo" class="page">

<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>

<StackLayout>
<StackLayout class="p-10" row="0">
<Label text="Default style = scrolls out of container" class="body m-b-10" />
<ListView items="{{ $value }}" height="40">
<ListView.itemTemplate>
<Label text="{{ $value }}" />
</ListView.itemTemplate>
</ListView>
</StackLayout>

<StackLayout class="p-10" row="1">
<Label text="Adding border changes the height but fixes scrolling" textWrap="true" class="body m-b-10" />
<ListView items="{{ $value }}" height="40" class="bordered">
<ListView.itemTemplate>
<Label text="{{ $value }}" />
</ListView.itemTemplate>
</ListView>
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius" class="body m-b-10" />
<ListView items="{{ $value }}" class="bordered fixed-height border-radius">
<ListView.itemTemplate>
<Label text="{{ $value }}" />
</ListView.itemTemplate>
</ListView>
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius = weird" class="body m-b-10" />
<ListView items="{{ $value }}" class="bordered fixed-height border-radius-nonuniform">
<ListView.itemTemplate>
<Label text="{{ $value }}" />
</ListView.itemTemplate>
</ListView>
</StackLayout>

<StackLayout class="p-10" row="3">
<Label text="border-width = weird" class="body m-b-10" />
<ListView items="{{ $value }}" class="bordered-nonuniform fixed-height">
<ListView.itemTemplate>
<Label text="{{ $value }}" />
</ListView.itemTemplate>
</ListView>
</StackLayout>

</StackLayout>
</Page>
1 change: 1 addition & 0 deletions apps/app/ui-tests-app/main-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export function pageLoaded(args: EventData) {
examples.set("modalview", "modal-view/modal-view");
examples.set("page", "page/main-page");
examples.set("perf", "perf/main-page");
examples.set("scroll-view", "scroll-view/main-page");
examples.set("segStyle", "segmented-bar/all");
examples.set("search-bar", "search-bar/main-page");
examples.set("tab-view", "tab-view/main-page");
Expand Down
16 changes: 16 additions & 0 deletions apps/app/ui-tests-app/scroll-view/main-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { EventData } from "tns-core-modules/data/observable";
import { SubMainPageViewModel } from "../sub-main-page-view-model";
import { WrapLayout } from "tns-core-modules/ui/layouts/wrap-layout";
import { Page } from "tns-core-modules/ui/page";

export function pageLoaded(args: EventData) {
const page = <Page>args.object;
const wrapLayout = <WrapLayout>page.getViewById("wrapLayoutWithExamples");
page.bindingContext = new SubMainPageViewModel(wrapLayout, loadExamples());
}

export function loadExamples() {
const examples = new Map<string, string>();
examples.set("scrolling-and-sizing", "scroll-view/scrolling-and-sizing");
return examples;
}
6 changes: 6 additions & 0 deletions apps/app/ui-tests-app/scroll-view/main-page.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Page loaded="pageLoaded">
<ScrollView orientation="vertical" row="1">
<WrapLayout id="wrapLayoutWithExamples"/>
</ScrollView>
</Page>
47 changes: 47 additions & 0 deletions apps/app/ui-tests-app/scroll-view/scrolling-and-sizing.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.p-10 {
padding: 10 20 10 20;
}

.m-b-10 {
margin-bottom: 10;
}

.page {
background-color: #F2F2F2;
}

ScrollView {
background-color: #FFF;
}

.bordered {
border-width: 5;
border-color: green;
}

.fixed-height {
height: 55;
}

.border-radius {
border-radius: 15;
}

.border-radius-nonuniform {
border-radius: 10 20 30 40;
}

.bordered-nonuniform {
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: purple;
border-top-width: 5;
border-right-width: 10;
border-bottom-width: 15;
border-left-width: 20;
}

.body {
font-size: 11;
}
65 changes: 65 additions & 0 deletions apps/app/ui-tests-app/scroll-view/scrolling-and-sizing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo" class="page">

<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>

<StackLayout>
<StackLayout class="p-10" row="0">
<Label text="Default style = scrolls out of container" class="body m-b-10" />
<ScrollView height="40">
<StackLayout>
<GridLayout width="30" height="30" backgroundColor="red" />
<GridLayout width="30" height="30" backgroundColor="yellow" />
<GridLayout width="30" height="30" backgroundColor="green" />
</StackLayout>
</ScrollView>
</StackLayout>

<StackLayout class="p-10" row="1">
<Label text="Adding border changes the height but fixes scrolling" textWrap="true" class="body m-b-10" />
<ScrollView class="bordered" height="40">
<StackLayout>
<GridLayout width="30" height="30" backgroundColor="red" />
<GridLayout width="30" height="30" backgroundColor="yellow" />
<GridLayout width="30" height="30" backgroundColor="green" />
</StackLayout>
</ScrollView>
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius" class="body m-b-10" />
<ScrollView class="bordered fixed-height border-radius">
<StackLayout>
<GridLayout width="30" height="30" backgroundColor="red" />
<GridLayout width="30" height="30" backgroundColor="yellow" />
<GridLayout width="30" height="30" backgroundColor="green" />
</StackLayout>
</ScrollView>
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius = weird" class="body m-b-10" />
<ScrollView class="bordered fixed-height border-radius-nonuniform">
<StackLayout>
<GridLayout width="30" height="30" backgroundColor="red" />
<GridLayout width="30" height="30" backgroundColor="yellow" />
<GridLayout width="30" height="30" backgroundColor="green" />
</StackLayout>
</ScrollView>
</StackLayout>

<StackLayout class="p-10" row="3">
<Label text="border-width = weird" class="body m-b-10" />
<ScrollView class="bordered-nonuniform fixed-height">
<StackLayout>
<GridLayout width="30" height="30" backgroundColor="red" />
<GridLayout width="30" height="30" backgroundColor="yellow" />
<GridLayout width="30" height="30" backgroundColor="green" />
</StackLayout>
</ScrollView>
</StackLayout>

</StackLayout>
</Page>
1 change: 1 addition & 0 deletions apps/app/ui-tests-app/text-view/main-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ export function loadExamples() {
examples.set("text-view-border", "text-view/text-view-border");
examples.set("text-view-hint-color", "text-view/text-view-hint-color");
examples.set("hint-text-color", "text-view/hint-text-color");
examples.set("scrolling-and-sizing", "text-view/scrolling-and-sizing");
return examples;
}
47 changes: 47 additions & 0 deletions apps/app/ui-tests-app/text-view/scrolling-and-sizing.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.p-10 {
padding: 10 20 10 20;
}

.m-b-10 {
margin-bottom: 10;
}

.page {
background-color: #F2F2F2;
}

TextView {
background-color: #FFF;
}

.bordered {
border-width: 5;
border-color: green;
}

.fixed-height {
height: 55;
}

.border-radius {
border-radius: 15;
}

.border-radius-nonuniform {
border-radius: 10 20 30 40;
}

.bordered-nonuniform {
border-top-color: red;
border-right-color: green;
border-bottom-color: blue;
border-left-color: purple;
border-top-width: 5;
border-right-width: 10;
border-bottom-width: 15;
border-left-width: 20;
}

.body {
font-size: 11;
}
35 changes: 35 additions & 0 deletions apps/app/ui-tests-app/text-view/scrolling-and-sizing.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo" class="page">

<Page.actionBar>
<ActionBar title="My App" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>

<StackLayout>
<StackLayout class="p-10" row="0">
<Label text="Default style = scrolls out of container" class="body m-b-10" />
<TextView hint="Add your comment..." />
</StackLayout>

<StackLayout class="p-10" row="1">
<Label text="Adding border changes the height but fixes scrolling" textWrap="true" class="body m-b-10" />
<TextView hint="Add your comment..." class="bordered" />
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius" class="body m-b-10" />
<TextView hint="Add your comment..." class="bordered fixed-height border-radius" />
</StackLayout>

<StackLayout class="p-10" row="2">
<Label text="border-radius = weird" class="body m-b-10" />
<TextView hint="Add your comment..." class="bordered fixed-height border-radius-nonuniform" />
</StackLayout>

<StackLayout class="p-10" row="3">
<Label text="border-width = weird" class="body m-b-10" />
<TextView hint="Add your comment..." class="bordered-nonuniform fixed-height" />
</StackLayout>

</StackLayout>
</Page>
5 changes: 4 additions & 1 deletion tns-core-modules/ui/core/view/view.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,10 @@ export class View extends ViewCommon {

_setNativeClipToBounds() {
let backgroundInternal = this.style.backgroundInternal;
this.nativeViewProtected.clipsToBounds = backgroundInternal.hasBorderWidth() || backgroundInternal.hasBorderRadius();
this.nativeViewProtected.clipsToBounds =
this.nativeViewProtected instanceof UIScrollView ||
backgroundInternal.hasBorderWidth() ||
backgroundInternal.hasBorderRadius();
}
}
View.prototype._nativeBackgroundState = "unset";
Expand Down
3 changes: 2 additions & 1 deletion tns-core-modules/ui/list-view/list-view.ios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ItemEventData } from ".";
import { ScrollEventData } from "../scroll-view";
import { ItemEventData } from ".";
import {
ListViewBase, View, KeyedTemplate, Length, Observable, Color,
separatorColorProperty, itemTemplatesProperty, layout, EventData
Expand Down
Loading