android_learning:headfirst_android_development_notes:chapter_5
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
android_learning:headfirst_android_development_notes:chapter_5 [2016/01/24 03:43] – mithat | android_learning:headfirst_android_development_notes:chapter_5 [2016/01/24 04:45] (current) – [Additional notes] mithat | ||
---|---|---|---|
Line 88: | Line 88: | ||
</ | </ | ||
- | ===== Additional notes ===== | + | ===== p. 219 ===== |
+ | Your text suggest a ScrollView can be used as a root ViewGroup: | ||
+ | <file xml content_main.xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | tools: | ||
+ | tools: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | ... | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | However, in my experience this leads to unpredictable results (top of the ScrollView being obscured, etc.). A more reliable strategy seems to be nesting a ScrollView inside a root ViewGroups: | ||
+ | <file xml content_main.xml> | ||
+ | <?xml version=" | ||
+ | < | ||
+ | xmlns: | ||
+ | xmlns: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | app: | ||
+ | tools: | ||
+ | tools: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | ... | ||
+ | |||
+ | < | ||
+ | android: | ||
+ | android: | ||
+ | android: | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Android Studio produces a warning stating that the '' | ||
+ | |||
+ | <WRAP center round info 90%> | ||
+ | In the examples above, I am using string literals for the text attributes---only because this is throwaway, quick-n-dirty, | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Additional notes on the UI builder | ||
If you examine the UI builder on a layout' | If you examine the UI builder on a layout' | ||
android_learning/headfirst_android_development_notes/chapter_5.1453607035.txt.gz · Last modified: 2016/01/24 03:43 by mithat