`

android字体小结

阅读更多
下文演示了android中的一些字体的效果,其中留意下最后的阴影效果:
<TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:paddingLeft="5sp"

        android:typeface="monospace"

        android:text="Hello Red Monospace"

        android:textSize="16sp"

        android:textColor="#ff0000"

        /> 

  

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:text="Sans Font:"

        android:textSize="16sp"

        android:paddingLeft="5sp"

        /> 

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:paddingLeft="5sp"

        android:typeface="sans"

        android:text="Hello Blue Sans"

        android:textSize="16sp"

        android:textColor="#0000ff"

        /> 

  

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:text="Serif Font:"

        android:textSize="16sp"

        android:paddingLeft="5sp"

        /> 

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:paddingLeft="5sp"

        android:paddingRight="2sp"

        android:typeface="serif"

        android:text="Hello Green Serif"

        android:textSize="16sp"

        android:textColor="#00ff00"

        /> 

  

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:paddingLeft="5sp"

        android:paddingTop="15sp"

        android:typeface="normal"

        android:text="I'm normal font but I'm also bold and italic"

        android:textSize="16sp"

        android:textStyle="bold|italic"

        android:textColor="#ffffff"

        /> 

  

    <TextView

        android:orientation="horizontal"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        android:paddingLeft="5sp"

        android:paddingTop="15sp"

        android:paddingBottom="15sp"

        android:typeface="normal"

        android:text="I'm normal (bold) font but I have a shadow"

        android:textSize="16sp"

        android:textStyle="bold"

        android:shadowColor ="#0f0f0f"

        android:shadowRadius="1.6"

        android:shadowDx="1.5"

        android:shadowDy="1.3"

        android:textColor="#000000"

        android:background="#ffffff"

        /> 

最后部分阴影效果:
android:shadowColor ="#0f0f0f"

        android:shadowRadius="1.6"

        android:shadowDx="1.5"

        android:shadowDy="1.3"

        android:textColor="#000000"

        android:background="#ffffff"
1
0
分享到:
评论

相关推荐

    android连连看游戏毕业论文

    1.6本章小结 5 第2章 基础知识与开发技术 6 2.1 Android技术简介 6 2.1.1 Android基本知识 6 2.1.2 Android系统特点 8 2.1.3 Android手机平台的优势 8 2.1.4 Android 手机游戏的市场价值 9 2.2 Java技术简介 11 2.3...

    Android TextView字体颜色设置方法小结

    主要介绍了Android TextView字体颜色设置方法,结合实例形式总结分析了Android开发中TextView设置字体颜色的常用技巧,需要的朋友可以参考下

    Android编程实现TextView字体颜色设置的方法小结

    本文实例讲述了Android编程实现TextView字体颜色设置的方法。分享给大家供大家参考,具体如下: 对于setTextView(int a)这里的a是传进去颜色的值。例如,红色0xff0000是指0xff0000如何直接传入R.color.red是没有办法...

    Android开发应用实战详解源代码

    第1章 androi简介 1.1 初识android 1.1.1 历史背景 1.1.2 android特性 1.1.3 android组件结构 1.1.4 android应用程序框架 1.1.5 android的竞争优势 1.1.6 android模拟器 1.2 搭建android开发环境 ...8.13 小结

    Android 4游戏编程入门经典

     1.10 小结 第2章 从android sdk开始  2.1 搭建开发环境  2.1.1 安装jdk  2.1.2 安装android sdk  2.1.3 安装eclipse  2.1.4 安装adt eclipse插件  2.1.5 eclipse快速浏览  2.1.6 一些实用的eclipse快捷键 ...

    Android高级编程--源代码

    1.10 小结 16 第2章 开始入手 17 2.1 Android开发 18 2.1.1 开始前的准备工作 18 2.1.2 创建第一个Android活动 22 2.1.3 Android应用程序的类型 27 2.2 面向移动设备的开发 28 2.2.1 关于硬件设计的考虑事项 ...

    android游戏编程入门

     1.10 小结 18  第2章 从Android SDK开始 19  2.1 搭建开发环境 19  2.1.1 安装JDK 20  2.1.2 安装Android SDK 20  2.1.3 安装Eclipse 21  2.1.4 安装ADT Eclipse插件 22  2.1.5 Eclipse快速浏览 23  2.1.6...

    android连连看毕业论文

    1.6 本章小结………………………………………...……………………………………………....5 第2章 基础知识与开发技术………………………………………………………………….…...6 2.1 Android技术简介………………...

    Android TextView高级显示技巧实例小结

    可以使用setTypeface(Typeface)方法来设置文本框内文本的字体,而Android的 Typeface又使用TTF字体文件来设置字体 所以,我们可以在程序中放入TTF字体文件,在程序中使用Typeface来设置字体:第一步,在assets目录下...

    React Native 开发指南_中文扫描完整版

    1.3 小结 4 第2章 React Native 工作原理 5 2.1 React Native 是如何工作的 5 2.2 渲染周期 7 2.3 在React Native 中创建组件 2.4 宿主平台接口 11 2.5 小结 12 第3章 构建你的第一个应用 13 3.1 搭建环境 ...

    工程硕士学位论文 基于Android+HTML5的移动Web项目高效开发探究

    2.4 本章小结 15 第三章 跨域交互缓存处理设计 17 3.1 跨域交互缓存处理需求 17 3.1.1 缓存技术WebStorage 17 3.1.2 跨域交互缓存处理需求 17 3.1.3 页面回退管理需求 17 3.2 缓存处理机制 18 3.2.1 跨域缓存处理 18...

    Cocos2D-X游戏开发技术精解

    作者介绍刘剑卓 有点文艺的IT男,会做美食的运动男,喜欢电影的80后。拥有八年的游 戏开发经验,精通移动平台以及PC平台游戏的开发,在过往的职业生涯已有 多款上线畅销游戏。...15.6 本章小结 403

Global site tag (gtag.js) - Google Analytics