zoukankan      html  css  js  c++  java
  • (二)Android 基本控件

    第一节:View 视图组件

    Andorid 中的View 视图组件,实现类是android.view.View 类,是绝大多数图形显示类的父类,提供了大量的方法和属性。在View 类下,有很多子类,如文本组件类,编辑框组件类,按钮组件类等等,供开发者使用;View 子类的实现类,在android.widget 包下。

    第二节:TextView 文本组件

    TextView 组件主要功能是显示文本;

    线性布局:LinearLayout 默认是水平方向horizontal 我们可以设置垂直方向线性布局vertical

    Layout_width, layout_height 设置

    wrap_content 包裹内容,内容多大,宽度或者长度就多大;

    match_parent 填充父容器;假如是顶部布局或控件为match_parent 将强制性让它布满整个屏幕。

    fill_parent 和match_parent 一样Android2.2 中match_parent 和fill_parent 是一个意思.两个参数意思一样,match_parent 更贴切,于是从2.2 开始两个词都可以用。那

    么如果考虑低版本的使用情况你就需要用fill_parent 了

    dp px sp

    Px 像素
    dp 不依赖像素
    sp 与缩放无关的抽象像素(Scale-independent Pixel)。sp 和dp 很类似但唯一的区别是,Android 系统允许
    用户自定义文字尺寸大小(小、正常、大、超大等等)

  • 相关阅读:
    uva400 Unix ls
    cf641 div2 abcd
    cf619 div2 abcd
    cf620 div2 abcde
    atc160
    cf638 div2 abcd
    CodeCraft-20(Div. 2 abcd
    cf Round 621 abcd
    luogu1941 飞扬的小鸟
    UVA1601 The Morning afther Halloween
  • 原文地址:https://www.cnblogs.com/wishwzp/p/5479989.html
Copyright © 2011-2022 走看看