Android中的app界面,属性含义

Android中的app界面,属性含义

  (2012-08-02 14:55:50)
标签: 

杂谈

分类: Android开发(界面为主)
Java代码:

  1. <?xml version="1.0" encoding="utf-8"?> 
  2. <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android 
  3. android:orientation="vertical" 
  4. android:layout_width="fill_parent" 
  5. android:layout_height="fill_parent" 
  6. android:background="#ffc5d1d4" 

  7. <com.google.android.maps.MapView 
  8. android:id="@+id/mapmain"
  9. android:layout_width="fill_parent" 
  10. android:layout_height="fill_parent"
  11. android:clickable="true"
  12. android:apiKey="0P18K0TAE0dO2GifdtbuScgEGLWe3p4CYUQngMg"
  13. />
  14. <TextView 
  15. android:id="@+id/lblMicroJobsToday" 
  16. android:layout_width="wrap_content" 
  17. android:layout_height="wrap_content" 
  18. android:text="MicroJobs for You Today Near:"
  19. android:textSize="20dp" 
  20. android:textColor="#FF000000"
  21. android:layout_centerHorizontal="true" 
  22. android:gravity="top" 
  23. />
  24. <Spinner 
  25. android:id="@+id/spnLocations" 
  26. android:layout_width="250dp" 
  27. android:layout_height="wrap_content" 
  28. android:layout_centerHorizontal="true" 
  29. android:layout_marginTop="2dp" 
  30. android:layout_below="@+id/lblMicroJobsToday" 
  31. />
  32. <Button 
  33. android:id="@+id/btnShowList" 
  34. android:layout_width="150dp" 
  35. android:layout_height="wrap_content" 
  36. android:text="List Jobs" 
  37. android:textSize="20sp" 
  38. android:gravity="center_vertical" 
  39. android:layout_centerInParent="true" 
  40. android:layout_alignParentBottom="true" 
  41. />
  42. </RelativeLayout>
复制代码

                 下面是代码代表的意思,大家要注意看了

Java代码:

  1. android:orientation
  2. //决定屏幕布局的“重心”方向。

  3. android:layout_width and android:layout_height
  4. //决定如何利用屏幕显示app的大小。

  5. android:background
  6. //决定app的背景颜色。(当有map覆盖后,这个属性其实作用不大)

  7. android:id
  8. //View的唯一的识别符,你将在java文件代码里使用这些id来和xml的view元素彼此交换。

  9. android:layout_width and android:layout_height
  10. //这2个属性和他们的parent元素息息相关,代码里使用了“fill_parent”指明了mapview将把它的父元
  11. //素大小填满。

  12. android:clickable
  13. //用户是否可以使用触屏点击。


  14. android:apiKey
  15.  


  16. Section starting <TextView
  17. //此view就类似于一个Lable。告诉用户他在看什么。

  18. android:text
  19. //label的内容。

  20. android:textSize
  21. //字符的大小。

  22. android:textColor
  23. //字符的颜色。

  24. android:layout_centerHorizontal
  25. //字符的排列方向是否居中。

  26. android:gravity



  27. Section starting <Spinner
  28. //这是一个标准的android控件用来让用户选择最近的位置或者其他记录在用户配置文件里的位置。


  29. android:layout_below
  30. //这个属性控制了spinner的位置。表示了这个元素是位于某某id元素之后的。

  31. Section starting <Button>
  32. //一个按钮。用来触发显示工作信息列表。


  33. android:layout_width and android:layout_height
  34. //按钮大小。

  35. android:text
  36. //按钮上的名称。

  37. android:textSize
  38. //text的字符大小。

  39. android:layout_centerInParent
  40. //按钮位置是否居中。

  41. android:layout_alignParentBottom
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值