zoukankan      html  css  js  c++  java
  • 下拉列表框与线性、帧布局管理器

    6.Spinner(下拉列表框)  

      6.1下拉列表选项的配置方式  

       第一步:在String.xml配置   

       <string name="hei">选择省份</string>      

       <string-array name="sheng">        

          <item>湖南</item>      

           <item>广州</item>        

          <item>浙江</item>       

        </string-array>

        第二部:指定资源   android:entries="@array/sheng"

             适配器配置    

        第一种:资源配置

       ArrayAdapter<CharSequence> adapterCity=ArrayAdapter.createFromResource         ( this, 资源id,列表显示样式);  //从资源文件夹读取信息   

         第二种:列表配置  

       ArrayAdapter<CharSequence> adapterCity=new ArrayAdapter<CharSequence>  (this,列表显示样式,集合数据);

    7.布局方式  

        7.1LinearLayout(线性布局)   

      常用属性:android:orientation="vertical  or horizontal"  垂直或水平布局        

           android:layout_width="fill_parent"       

           android:layout_height="wrap_content"    

        wrap_content:宽度/高度  和内容的宽度/高度相同    fill_parent:宽度/高度  是整父件的宽度/高度相同

        7.2:FrameLayout(帧布局)

  • 相关阅读:
    shell 基础进阶 *金字塔
    shell,awk两种方法写9*9乘法表
    shell脚本判断一个用户是否登录成功
    shell 冒泡算法 解决数组排序问题
    shell 石头剪刀布
    应用shell (ssh)远程链接主机
    nmcli命令使用
    光盘yum源autofs按需挂载
    LVM扩容,删除
    LVM创建
  • 原文地址:https://www.cnblogs.com/tz4630/p/6889900.html
Copyright © 2011-2022 走看看