Size: 845
Comment:
|
← Revision 7 as of 2016-09-05 14:34:06 ⇥
Size: 3355
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= Chapter 4 Notes = |
= Chapter 4 Notes (start on "Frame and BoxView) = |
Line 6: | Line 5: |
All about scrolling a page that doesn't fit on the screen. |
All about scrolling a page that doesn't fit on the screen. |
Line 10: | Line 8: |
||'''Concept''' ||'''Page''' || || New Layouts were introduced: {{{AbsoluteLayout, Grid, RelativeLayout, StackLayout}}}, we'll be focusing on {{{StackLayout}}} || 60 || || Scrolling content - Using {{{LayoutOptions}}}.{{{[Start|Center|End|Fill]AndExpand}}} to allow the element that will scroll to fill the space || 70 || || Reflection and Linq to objects to create a list of Labels that show the results of different options || 72 || || {{{BoxView}}} is a filled rectangle || 74 || || {{{Frame}}} is a Layout descendant that can contain a single view or another layout. Background is white on iPhone, but transparent on the others. || 72 || |
|
Line 11: | Line 15: |
|| '''Concept''' || '''Page''' || | |
Line 15: | Line 18: |
=== BlackCat === Page |
=== ColorLoopPage === Page 61 |
Line 21: | Line 23: |
1. ? | 1. Colorizing text |
Line 23: | Line 25: |
Classes: | Classes: |
Line 25: | Line 27: |
1. ? | No new classes here. |
Line 27: | Line 29: |
=== ColorBlocks === | |
Line 29: | Line 30: |
Page | === ColorList === Page 62 Concepts: A more painful way of creating the colorized text of the previous program Classes: No new classes. === ReflectedColors === Page 65 |
Line 33: | Line 43: |
1. ? | 1. Reflection (See the .GetRuntimeFields() call) 1. ScrollView - actually scrolling the page. 1. Luminosity of the font used to determine background color. 1. Used the Device to get a named font size {{{GentNamedSize}}}. |
Line 35: | Line 48: |
Classes: | Classes: |
Line 37: | Line 50: |
1. ? | 1. ScrollVew |
Line 39: | Line 52: |
=== ColorList === | |
Line 41: | Line 53: |
Page | === VerticalOptionsDemo === Page |
Line 45: | Line 58: |
1. ? | 1. Linq to objects to create an IEnumerable<Label> set. 1. Reflection |
Line 47: | Line 61: |
Classes: | Classes: No new classes yet. |
Line 49: | Line 63: |
1. ? | The image below shows the output. The Blue background text labels fit exactly the text contained in them. The yellow background text labels contain a label that has the "AndExpand" appended. These labels are not a different size (except the last one) but occupy a more spacious spot on the screen. The last one is a FillAndExpand and it actually does change the size of the Label because it fills the available space. |
Line 51: | Line 65: |
=== ColorLoop === | {{attachment:VerticalOptionsForStackLayoutContents.png}} |
Line 53: | Line 67: |
Page | === FramedTextPage === Page 75 |
Line 57: | Line 72: |
1. ? | This is just a Demo of {{{BoxView}}}and {{{Frame}}}ed text. |
Line 59: | Line 74: |
Classes: | Classes: |
Line 61: | Line 76: |
1. ? | 1. {{{BoxView}}} 1. {{{Frame}}} |
Line 63: | Line 79: |
=== FramedText === Page |
=== SizedBoxView (Can be skiped) === Page 78 - 80 |
Line 69: | Line 84: |
1. ? | 1. Demo's BoxView as only content. 1. Demo's BoxView default 40x40 size. 1. Demo's WidthRequest and HeightRequest properties used for LayoutOpotions.Left|Right|Center. They contain "Request" because they are a request (over ridden by .Fill for example) and because Width and Height are read only. Classes: |
Line 71: | Line 89: |
Classes: | No new classes. |
Line 73: | Line 91: |
1. ? | === ColorBlocks === Page 80 - 81 |
Line 75: | Line 94: |
=== ReflectedColors === Page |
Note: Spend time on this one as it is an excellent example of a more complex layout. |
Line 81: | Line 98: |
1. ? | 1. Nested Layout concepts 1. String.Format |
Line 83: | Line 101: |
Classes: | Classes: |
Line 85: | Line 103: |
1. ? | No new classes. |
Line 87: | Line 105: |
=== SizedBoxView === | |
Line 89: | Line 106: |
Page | === BlackCatPage === Page 83 - 86 |
Line 93: | Line 111: |
1. ? | 1. Scrolling text 1. Reflection to get a text file resource - that is a text file stored in the program as a resource. 1. Reading from a Stream using a StreamReader 1. using - I may have used this before, but this is a good place to talk about the using construct to define scope. |
Line 95: | Line 117: |
Classes: | Classes: |
Line 97: | Line 119: |
1. ? === VerticalOptionsDemo === Page Concepts: 1. ? Classes: 1. ? |
1. {{{ScrollView}}} allows a page to flow outside of the viewable area of the screen and for you to scroll through the page. |
Chapter 4 Notes (start on "Frame and BoxView)
Title: Scrolling the Stack
Summary
All about scrolling a page that doesn't fit on the screen.
Programming Concepts Summary
Concept |
Page |
New Layouts were introduced: AbsoluteLayout, Grid, RelativeLayout, StackLayout, we'll be focusing on StackLayout |
60 |
Scrolling content - Using LayoutOptions.[Start|Center|End|Fill]AndExpand to allow the element that will scroll to fill the space |
70 |
Reflection and Linq to objects to create a list of Labels that show the results of different options |
72 |
BoxView is a filled rectangle |
74 |
Frame is a Layout descendant that can contain a single view or another layout. Background is white on iPhone, but transparent on the others. |
72 |
Programs
ColorLoopPage
Page 61
Concepts:
- Colorizing text
Classes:
No new classes here.
ColorList
Page 62
Concepts: A more painful way of creating the colorized text of the previous program
Classes: No new classes.
ReflectedColors
Page 65
Concepts:
Reflection (See the .GetRuntimeFields() call)
ScrollView - actually scrolling the page.
- Luminosity of the font used to determine background color.
Used the Device to get a named font size GentNamedSize.
Classes:
VerticalOptionsDemo
Page
Concepts:
Linq to objects to create an IEnumerable<Label> set.
- Reflection
Classes: No new classes yet.
The image below shows the output. The Blue background text labels fit exactly the text contained in them. The yellow background text labels contain a label that has the "AndExpand" appended. These labels are not a different size (except the last one) but occupy a more spacious spot on the screen. The last one is a FillAndExpand and it actually does change the size of the Label because it fills the available space.
FramedTextPage
Page 75
Concepts:
This is just a Demo of BoxViewand Frameed text.
Classes:
BoxView
Frame
SizedBoxView (Can be skiped)
Page 78 - 80
Concepts:
Demo's BoxView as only content.
Demo's BoxView default 40x40 size.
Demo's WidthRequest and HeightRequest properties used for LayoutOpotions.Left|Right|Center. They contain "Request" because they are a request (over ridden by .Fill for example) and because Width and Height are read only.
Classes:
No new classes.
ColorBlocks
Page 80 - 81
Note: Spend time on this one as it is an excellent example of a more complex layout.
Concepts:
- Nested Layout concepts
- String.Format
Classes:
No new classes.
BlackCatPage
Page 83 - 86
Concepts:
- Scrolling text
- Reflection to get a text file resource - that is a text file stored in the program as a resource.
Reading from a Stream using a StreamReader
- using - I may have used this before, but this is a good place to talk about the using construct to define scope.
Classes:
ScrollView allows a page to flow outside of the viewable area of the screen and for you to scroll through the page.