Android 中各种XML文件的作用_Android, Python及开发编程讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  Android, Python及开发编程讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 2081 | 回复: 0   主题: Android 中各种XML文件的作用        下一篇 
薯片
注册用户
等级:中士
经验:237
发帖:75
精华:0
注册:2012-2-10
状态:离线
发送短消息息给薯片 加好友    发送短消息息给薯片 发消息
发表于: IP:您无权察看 2015-7-8 18:04:28 | [全部帖] [楼主帖] 楼主

1、arrays.xml     定义数组

  1. <resources>
  2. <string-array name="proxy_types">
  3. <item>HTTP</item>
  4. <item>SOCKS4</item>
  5. <item>SOCKS5</item>
  6. </string-array> 
  7. </resources>



2、colors.xml 定义颜色

  1. <resources>
  2. <color name="blue_sky">#A0C8FF</color>
  3. <color name="vert_manu">#CCFF00</color>
  4. <color name="black">#000000</color>
  5. <color name="white">#FFFFFF</color>
  6. <color name="red">#FF0000</color>
  7. <color name="link_color">#FF0066CC</color>
  8. <color name="simiple_button_color">#FFF</color>
  9. <color name="blue">#0000FF</color>
  10. <color name="grey">#FFCBD2D8</color>
  11. </resources>



3、dimens.xml   定义尺寸

  1. <resources>
  2.          <dimen name="bottom_tab_font_size">12dp</dimen>
  3.          <dimen name="bottom_tab_padding_up">5dp</dimen>
  4.          <dimen name="bottom_tab_padding_drawable">8dp</dimen>
  5. </resources>



4、drawables.xml 定义画布

  1. <resources>
  2.       <item type="drawable" name="shader1">#7f7f7f7f</item>
  3.          <item type="drawable" name="highlight">#cf7f7f7f</item>
  4.      <item type="drawable" name="barbg">#ef0a4267</item>
  5.      <item type="drawable" name="trans">#00000000</item>
  6.      <item type="drawable" name="chatdivider">#ffd6dadc</item>
  7. </resources>



5、strings.xml 定义字符串

  1. <resources>
  2.         <string name="app_name">Beem</string>
  3.         <string name="OkButton">Ok</string>
  4.         <string name="ClearButton">Clear</string>
  5. </resources>



6、styles.xml 定义样式

  1. <resources>
  2.          <style name="Label">
  3.                  <item name="android:textSize">18sp</item>
  4.                  <item name="android:textStyle">bold</item>
  5.                  <item name="android:typeface">sans</item> 
  6.                  <item name="android:focusable">false</item>  
  7.                  <item name="android:padding">12dip</item>
  8.          </style>
  9. </resources>



7、phoinix_popumenu_style.xml     selector选择

  1. <selector xmlns:android="http://schemas.android.com/apk/res/android">
  2.      <item android:state_focused="true" android:state_pressed="true"  android:drawable="@drawable/phoinix_pushmail_btn_selected" />
  3.      <item android:state_focused="false" android:state_pressed="true"  android:drawable="@drawable/phoinix_pushmail_btn_selected" />
  4.      <item android:state_focused="true" android:drawable="@drawable/phoinix_small_selected"/>
  5. </selector>



8、menu 菜单

  1. <menu xmlns:android="http://schemas.android.com/apk/res/android">
  2.          <group>
  3.                         <item android:id="@+id/chat_menu_contacts_list" android:visible="true"
  4.                          android:title="@string/chat_menu_contacts_list" android:icon="@drawable/ic_menu_friendslist" />
  5.                          
  6.                          <item android:id="@+id/chat_menu_change_chat" android:visible="true"
  7.                          android:title="@string/chat_menu_change_chat" android:icon="@drawable/ic_menu_chat_dashboard" />
  8.          </group>
  9.          
  10.         <item android:id="@+id/chat_menu_close_chat" android:visible="true"
  11.          android:title="@string/chat_menu_close_chat" android:icon="@drawable/ic_menu_end_conversation" />
  12. </menu>



9、drawable  white_background.xml  白色圆角矩形做背景

  1. <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> 
  2.     <solid android:color="#FFFFFF" /> 
  3.     <corners android:topLeftRadius="5px" 
  4.          android:topRightRadius="5px" android:bottomLeftRadius="5px" 
  5.          android:bottomRightRadius="5px"/> 
  6.    <!--   <padding android:left="10dp" android:top="10dp" android:right="10dp" 
  7.                         android:bottom="10dp" />  
  8.           <stroke   
  9.              android:dashWidth="2dp"   
  10.              android:dashGap="2dp"  
  11.              android:width="2dp"   
  12.              android:color="#FF00ff00"></stroke>  --> 
  13. </shape>



10、anim  旋转动画

  1. <set xmlns:android="http://schemas.android.com/apk/res/android">  
  2.       
  3. <rotate   
  4.    android:interpolator="@android:anim/accelerate_decelerate_interpolator"  
  5.    android:fromDegrees="0"   
  6.    android:toDegrees="+360"  
  7.    android:duration="3000" />  

  8. <!-- rotate 旋转动画效果  

  9.         属性:interpolator 指定一个动画的插入器,用来控制动画的速度变化  

  10.         fromDegrees 属性为动画起始时物件的角度      
  11.         toDegrees   属性为动画结束时物件旋转的角度,+代表顺时针  
  12.         duration  属性为动画持续时间,以毫秒为单位  
  13. -->  
  14. </set>


--转自 北京联动北方科技有限公司




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论