studyjams notes PS1 设计一个静态的app
2016-04-18 21:51
344 查看
目标
学习设计一个view学习合理放置view
学习设置view style
核心代码
<RelativeLayout xmlns:android="http://schemas.android.c3om/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:scaleType="centerCrop" android:src="@drawable/androidparty" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:fontFamily="sans-serif-light" android:padding="20dp" android:text="Happy Birthday, Ben!" android:textColor="@android:color/white" android:textSize="36sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:fontFamily="sans-serif-light" android:padding="20dp" android:text="From, Lyla!" android:textColor="@android:color/white" android:textSize="36sp" /> </RelativeLayout>
QA
Coffee Break Challenge - 1 - Coffee Break Challenge Question 1Q: 如果我想在手机上显示一个图片,我该使用什么控件?
A: ImageView
Coffee Break Challenge - 2 - Coffee Break Challenge Question 2
Q: android:layout_weight / android:text / android:src 描述了什么
A: layout
Coffee Break Challenge - 3 - Coffee Break Challenge Question 3
Q: 用驼峰法重写 “I like practice sets the best”
A: ILikePracticeSetsTheBest
Coffee Break Challenge - 4 - Coffee Break Challenge Question 4
Q: 相对布局(RelativeLayout)和线性布局(LinearLayout)是什么?
A: 相对布局能让控件在相对参考系里布局,方向比线性自由,
而线性布局专注横向或者纵向布局控件。
Coffee Break Challenge - 5 - Coffee Break Challenge Question 5
Q: I always need to X and X my tags 我总是需要对我的标签做哪两件事情?
A: start and close it
Coffee Break Challenge - 6 - Coffee Break Challenge Question 6
Q: 两个导师的名字是什么?
A: Katherine 和 Kunal
Coffee Break Challenge - 7 - Coffee Break Challenge Question 7
Q: 代码挑错…
A: 21行,android:layout_weight=1,应该加引号为 android:layout_weight=“1”
Coffee Break Challenge - 8 - Coffee Break Challenge Question 8
Q: 这个 TextView 的宽度是?
A: TextView 的宽度是 350dp
Coffee Break Challenge - 9 - Coffee Break Challenge Question 9
Q: 让那个 Button 正确的显示在屏幕的下方
A:
android:layout_centerHorizontal=”true”
android:layout_alignParentBottom=”true”
Coffee Break Challenge - 10 - Coffee Break Challenge Question 10
Q: 使用给定的 XML 代码并且假定屏幕有 600dp 高,那么 Chai tea TextView 的高度是多少?
A: (600-200) *1 /4 , 高度是 100dp。
Coffee Break Challenge - 11 - Coffee Break Challenge Final Question
Q: 在为谁做这个咖啡?
A: Lyla Fujiwara
她的github在此:https://github.com/ceruleanotter
学习笔记截图
结尾
android 团队学习且行且珍惜相关文章推荐
- Swift提出“区块链路线图”,谋求突…
- android textView实现跑马灯效果
- ios入门
- Android性能优化-StrictMode(严苛模式)
- Apple Store连网后内容空白页的解决办法
- iOS:在OC中调用JS脚本
- android仿超级课程表demo
- Android基础控件 - RadioButton与CheckBox
- 消息人士称,Google考虑将Swift作为安卓的主要编程语言
- Android 学习记录-Activity生命周期
- 各种控件和布局--android学习
- Android .9.png图片的制作与使用
- Android学习第八篇——DrawerLayout
- Trapping Rain Water
- Unity Coroutine协程
- 安装Android Studio时出现‘tools.jar’ seems to be not in Android Studio classpath.
- Android支持Emoji表情 MySQL PHP
- MapReudce源码分析之Mapper
- android TextView 笔记
- Handler使用方法