SAPFI面试试题及答案
2011-07-08 21:21
316 查看
有关FrameLayout的翻译,一直都有争议,从习惯来看,Frame应为框架,但这里若以框架概之,显得有些不妥,因此我参考了“单帧布局”这一翻译。
单帧布局尤为简单,这种布局下每个添加的子控件都被放在布局的左上角,并覆盖在前一子控件的上层。看下面这个例子:
< ?xml version="1.0" encoding="utf-8"? >
< FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
< TextView
android:text="big"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50pt"/ >
< TextView
android:text="middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20pt"/ >
< TextView
android:text="small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10pt"/ >
< /FrameLayout >
这里从底层到外层依次放了三个单词:big(50pt)、middle(20pt)、small(10pt),效果如下:
需要注意的是,当我们使用ImageView显示图片时,应当用android:src指定要显示的图片,而非android:background.
单帧布局尤为简单,这种布局下每个添加的子控件都被放在布局的左上角,并覆盖在前一子控件的上层。看下面这个例子:
< ?xml version="1.0" encoding="utf-8"? >
< FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
< TextView
android:text="big"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="50pt"/ >
< TextView
android:text="middle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20pt"/ >
< TextView
android:text="small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10pt"/ >
< /FrameLayout >
这里从底层到外层依次放了三个单词:big(50pt)、middle(20pt)、small(10pt),效果如下:
需要注意的是,当我们使用ImageView显示图片时,应当用android:src指定要显示的图片,而非android:background.
相关文章推荐
- 贴上答案作参考--嵌入式研发工程师面试试题大全(ANSI C/C++方面的知识)
- 硬件工程师面试试题答案
- 面试试题和答案
- C#.Net的常见面试试题附答案
- Java Web面试的试题及其答案(一套)
- 一些网页设计师面试试题及参考答案
- 2018最新Web前端经典面试试题及答案
- 面试ASP.NET程序员的笔试题和机试题(转,有点意思,答案不是很标准)
- c/c++经典面试试题及标准答案
- C#整理面试试题分类以及sql数据库(含答案)
- 2018最新Web前端经典面试试题及答案
- asp.net c# 常见面试试题总结汇总(含答案)
- Java面试经典试题及答案
- 英语面试试题及答案中英文对照30题
- C#.Net的常见面试试题附答案
- 2007年初某IT公司招聘网络管理员面试考试试题(答案)
- c/c++经典面试试题及标准答案
- 华为面试试题(无答案)