一、float的配置方法

andriod 默认不支持float型的设置,在values 下的新建floats.xml 文件,在内部添加如下代码:

<resources>
<item name="chart_view_line_width" format="float" type="dimen"> 3.3</item>
<item name="chart_view_text_size" format="float" type="dimen">17</item>
</resources>

在代码中的使用方法是:

r.setLineWidth(Float.parseFloat(mContext.getResources().getString(R.string.chart_view_line_width)));
r.setChartValuesTextSize(Float.parseFloat(mContext.getResources().getString(R.string.chart_view_text_size)));

二、integer的配置方法

android 默认支持integer形的设置,在values下新建integers.xml文件,如下:

<resources>
<integer name="emotion_columm_num">14</integer>
<integer name="right_icon_visibility">0</integer>
<integer name="webview_fix_height">65</integer>
<integer name="right_icon_orientation">1</integer>
<integer name="dashboard_flip_interval">4000</integer>
<integer name="pairing_duration">100</integer>
</resources>

代码中使用是:

<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/select"
android:oneshot="false" > <item
android:drawable="@drawable/pairing_01"
android:duration="@integer/pairing_duration"/>
<item
android:drawable="@drawable/pairing_02"
android:duration="@integer/pairing_duration"/>
<item
android:drawable="@drawable/pairing_03"
android:duration="@integer/pairing_duration"/> </animation-list>

mContext.getResources().getInteger(R.integer.columns);

Android 在xml中配置 float 和 integer 值的更多相关文章

  1. 在web.xml中配置error-page

    在web.xml中配置error-page 在web.xml中有两种配置error-page的方法,一是通过错误码来配置,而是通过异常的类型来配置,分别举例如下: 一.   通过错误码来配置error ...

  2. web.xml中配置log4j

    1.将 commons-logging.jar和 log4j.jar加入你的项目中:2.在src/下创建log4j.properties|log4j.xml文件:3.在web.xml中配置log4j的 ...

  3. web.xml中配置Spring中applicationContext.xml的方式

    2011-11-08 16:29 web.xml中配置Spring中applicationContext.xml的方式 使用web.xml方式加载Spring时,获取Spring applicatio ...

  4. SSH整合,applicationContext.xml中配置hibernate映射文件问题

    今天在applicationContext.xml中配置sessionFactory时遇到了各种头疼的问题,现在总结一下: 1.<property name="mappingDirec ...

  5. web.xml 中配置了error-page但不起作用问题

    问题: 在web.xml 中配置了 error-page,但是好像不起作用,就是跳转不到指定的页面. 配置信息如下: <!-- 400错误 --> <error-page> & ...

  6. 源码跟读,Spring是如何解析和加载xml中配置的beans

    Spring版本基于: 跟踪代码源码基于: https://github.com/deng-cc/KeepLearning commit id:c009ce47bd19e1faf9e07f12086c ...

  7. struts2 在 Action 或 Interceptor 中获取 web.xml 中配置的 <context-param> 参数 (这是我的第一篇博文,哈哈。)

    最近为了改一个问题,想加一个控制开关,就在web.xml 中配置了一个 <context-param> 参数,并在 Action 或 Interceptor 中获取参数值. 1.在 web ...

  8. 在web.xml中配置监听器来控制ioc容器生命周期

    5.整合关键-在web.xml中配置监听器来控制ioc容器生命周期 原因: 1.配置的组件太多,需保障单实例 2.项目停止后,ioc容器也需要关掉,降低对内存资源的占用. 项目启动创建容器,项目停止销 ...

  9. 在哪个web.xml中配置welcome页面

    是在tomcat的web.xml中配置,而不是在你的%web-project-root%/WEB-INF/web.xml中! 示例 <welcome-file-list> <welc ...

随机推荐

  1. Eclipse-修改工程名

    Eclipse-修改工程名 来自:http://southking.iteye.com/blog/1821754   直接修改工程可能会产生一些莫名其妙的问题,需遵循以下四步: 1. 右键工程:Ref ...

  2. Linux中exec命令相关

    Linux中exec命令相关 exec和source都属于bash内部命令(builtins commands),在bash下输入man exec或man source可以查看所有的内部命令信息. b ...

  3. Python3学习(2)-中级篇

    Python3学习(1)-基础篇 Python3学习(2)-中级篇 Python3学习(3)-高级篇 切片:取数组.元组中的部分元素 L=['Jack','Mick','Leon','Jane','A ...

  4. log_reuse_wait_desc为REPLICATION,日志暴大,无法收缩

    早上检查数据发现,有一台数据的硬盘空间只剩下几MB.习惯性检查日志文件,发现日志文件居然暴增到了350多GB 首先备份日志,再收缩-------无变化.(实际上日志备份每1小时1挡,正常在跑.) -- ...

  5. Ascii Design 1.0.2,好玩的 ASCII 字符设计工具

    Ascii Design 1.0.2 可检查系统是否已安装 figlet 包(对非 Windows 用户),对代码做了一些改进,修复了使用 Qt 4.8.x 时的编译警告信息. Ascii Desig ...

  6. Android 5.x特性概览二

    上文 ,对Android 5.X特性,主要是Material Design的特性进行了介绍,这篇文章我们来使用Material Design主题. Material Design 现在有三种默认的主题 ...

  7. 尝试在mac上用dotnet cli运行asp.net core示例程序

    自从知道微软用dotnet cli取代dnx之后,一直在等dotnet cli支持asp.net core... 昨天看到这篇新闻(ASP.NET Core 1.0 Hello World)后,才知道 ...

  8. 深入理解javascript 中的 delete(转)

    在这篇文章中作者从<JavaScript面向对象编程指南>一书中关于 delete 的错误讲起,详细讲述了关于 delete 操作的实现, 局限以及在不同浏览器和插件(这里指 firebu ...

  9. Mac下安装zshell

    Mac 下安装zshell 什么是shell 大多数命令行用户接触最多的是Bash,因为Bash是各个版本操作系统(Linux&Mac)的默认shell. 查看当前使用的shell $ ech ...

  10. [51单片机] nRF24L01 无线模块 测试 按键-灯-远程控制

    哈哈,穷吊死一个,自己做的一个超简单的板还没有电源提供,只得借助我的大开发板啦.其实这2个模块是完全可以分开的,无线嘛,你懂得!进入正题,这个实验的功能就是一个发送模块(大的那个板)连接4个按键,通过 ...