当前位置:  编程技术>移动开发
本页文章导读:
    ▪调剂状态栏的样式        调节状态栏的样式 <!-- Sets the text styles --><?xml version="1.0" encoding="utf-8"?><!-- Sets the text styles --><resources>     <style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle">.........
    ▪ RatingBar自定义设立        RatingBar自定义设置 1.<?xml version="1.0" encoding="utf-8"?><resources> <style name="foodRatingBar" parent="@android:style/Widget.RatingBar">  <item name="android:progressDrawable">@drawable/food_ratingbar_full</item.........
    ▪ editView 中字字句句加入动画       editView 中字里行间加入动画 setContentView(R.layout.main);               TextView textView  = (TextView) findViewById(R.id.textview);              SpannableString ss = new SpannableString("abc");              Drawable d .........

[1]调剂状态栏的样式
    来源: 互联网  发布时间: 2014-02-18
调节状态栏的样式

<!-- Sets the text styles -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Sets the text styles -->
<resources>
     <style name="CustomWindowTitleText" parent="android:TextAppearance.WindowTitle">
          <item name="android:textSize">20dip</item>
          <item name="android:textColor">#5599FF</item>
          <item name="android:textStyle">bold|italic</item>
     </style>
     <!-- Changes the background color of the title bar -->
     <style name="CustomWindowTitleBackground">
           <item name="android:background">#222222</item>
     </style>

     <!-- Set the theme for the window title -->
     <!-- NOTE: setting android:textAppearence to style defined above -->
     <style name="CustomWindowTitle" parent="android:WindowTitle">
          <item name="android:textAppearance">@style/CustomWindowTitleText</item>
          <item name="android:shadowDx">0</item>
          <item name="android:shadowDy">0</item>
          <item name="android:shadowRadius">5</item>
          <item name="android:shadowColor">#1155CC</item>
      </style>
      <!-- Override properties in the default theme -->
      <!-- NOTE: you must explicitly the windowTitleSize property, the title bar will not re-size automatically, text will be clipped -->
      <style name="CustomTheme" parent="android:Theme">
           <item name="android:windowTitleSize">40dip</item>
           <item name="android:windowTitleStyle">@style/CustomWindowTitle</item>
           <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
      </style>
</resources>


    
[2] RatingBar自定义设立
    来源: 互联网  发布时间: 2014-02-18
RatingBar自定义设置

1.<?xml version="1.0" encoding="utf-8"?>
<resources>
 <style name="foodRatingBar" parent="@android:style/Widget.RatingBar">
  <item name="android:progressDrawable">@drawable/food_ratingbar_full</item>
  <item name="android:minHeight">48dip</item>
    <item name="android:maxHeight">48dip</item>
 </style>
</resources>

 

2.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+android:id/background"
          android:drawable="@drawable/food_ratingbar_full_empty" />
    <item android:id="@+android:id/secondaryProgress"
          android:drawable="@drawable/food_ratingbar_full_empty" />
    <item android:id="@+android:id/progress"
          android:drawable="@drawable/food_ratingbar_full_filled" />
</layer-list>

 

3.

 

<?xml version="1.0" encoding="utf-8"?>

<!-- This is the rating bar drawable that is used to
show a filled cookie. -->
<selector
    xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_pressed="true"
          android:state_window_focused="true"
          android:drawable="@drawable/cookie" />

    <item android:state_focused="true"
          android:state_window_focused="true"
          android:drawable="@drawable/cookie" />

    <item android:state_selected="true"
          android:state_window_focused="true"
          android:drawable="@drawable/cookie" />

    <item android:drawable="@drawable/cookie" />

</selector>

 

4.

<RatingBar  android:id="@+id/my_rating_bar"
   ...
    />

 

 


    
[3] editView 中字字句句加入动画
    来源: 互联网  发布时间: 2014-02-18
editView 中字里行间加入动画

setContentView(R.layout.main);               TextView textView  = (TextView) findViewById(R.id.textview);  
            SpannableString ss = new SpannableString("abc");  
            Drawable d = getResources().getDrawable(R.drawable.icon32);  
 
 
            d.setBounds(0, 0, d.getIntrinsicWidth(), d.getIntrinsicHeight());  
            ImageSpan span = new ImageSpan(d, ImageSpan.ALIGN_BASELINE);  
            ss.setSpan(span, 0, 3, Spannable.SPAN_INCLUSIVE_EXCLUSIVE);  
 
 
            textView.setText(ss);  


    
最新技术文章:
▪Android开发之登录验证实例教程
▪Android开发之注册登录方法示例
▪Android获取手机SIM卡运营商信息的方法
▪Android实现将已发送的短信写入短信数据库的...
▪Android发送短信功能代码
▪Android根据电话号码获得联系人头像实例代码
▪Android中GPS定位的用法实例
▪Android实现退出时关闭所有Activity的方法
▪Android实现文件的分割和组装
▪Android录音应用实例教程
▪Android双击返回键退出程序的实现方法
▪Android实现侦听电池状态显示、电量及充电动...
▪Android获取当前已连接的wifi信号强度的方法
▪Android实现动态显示或隐藏密码输入框的内容
▪根据USER-AGENT判断手机类型并跳转到相应的app...
▪Android Touch事件分发过程详解
▪Android中实现为TextView添加多个可点击的文本
▪Android程序设计之AIDL实例详解
▪Android显式启动与隐式启动Activity的区别介绍
▪Android按钮单击事件的四种常用写法总结
▪Android消息处理机制Looper和Handler详解
▪Android实现Back功能代码片段总结
▪Android实用的代码片段 常用代码总结
▪Android实现弹出键盘的方法
▪Android中通过view方式获取当前Activity的屏幕截...
▪Android提高之自定义Menu(TabMenu)实现方法
▪Android提高之多方向抽屉实现方法
▪Android提高之MediaPlayer播放网络音频的实现方法...
▪Android提高之MediaPlayer播放网络视频的实现方法...
▪Android提高之手游转电视游戏的模拟操控
 


站内导航:


特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

©2012-2021,,E-mail:www_#163.com(请将#改为@)

浙ICP备11055608号-3