Action Bar(title文字大小问题 基本运用)
来源:互联网 发布:比特币挖矿用什么软件 编辑:程序博客网 时间:2024/05/19 11:18
本文出自:http://blog.csdn.net/dt235201314/article/details/50966456
一丶任务
(1)找到menu.xml
<menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/loginId" android:textColor="@color/txt_white_color" android:typeface="serif" android:title="@string/login_name" android:showAsAction="withText|ifRoom"/> </menu>添加textSize属性发现并没什么用
(2)找到java代码对应部分,发现并没用修改文字大小的方法,改来改去行不通
二丶百度
(1)可用有关且有助于理解的文章
自定义ActionBar标题与菜单中的文字样式
链接:http://www.cnblogs.com/angeldevil/p/3836214.html(2)类似问题且已解决文章
【已解决】Android中菜单的字体太小了:设置actionbar中menu的text的size
链接:http://www.tuicool.com/articles/ue6Nbi(3)Action Bar加强
Android Action Bar 详解篇
链接:http://blog.csdn.net/yuxlong2010/article/details/9299507
这一篇写得很详细,基本概括了Action Bar常用功能
三丶其他知识
Android中通过typeface设置字体
Android系统默认支持三种字体,分别为:“sans”, “serif”, “monospace",除此之外还可以使用其他字体文件(*.ttf)
方法一:XML中使用android默认字体
<!-- 使用默认的sans字体-->
<TextView Android:id="@+id/sans"
Android:text="Hello,World"
Android:typeface="sans"
Android:textSize="20sp" />
<!-- 使用默认的serifs字体-->
<TextView Android:id="@+id/serif"
Android:text="Hello,World"
Android:typeface="serif"
Android:textSize="20sp" />
<!-- 使用默认的monospace字体-->
<TextView Android:id="@+id/monospace"
Android:text="Hello,World"
Android:typeface="monospace"
Android:textSize="20sp" />
方法二:在Android中可以引入其他字体,首先要将字体文件保存在assets/fonts/目录下
1. <!-- 这里没有设定字体,将在Java代码中设定-->
<TextView Android:id="@+id/custom"
Android:text="Hello,World"
Android:textSize="20sp" />
2. java程序中引入其他字体关键代码
//得到TextView控件对象
TextView textView =(TextView)findViewById(R.id.custom);
//将字体文件保存在assets/fonts/目录下,创建Typeface对象
Typeface typeFace =Typeface.createFromAsset(getAssets(),"fonts/HandmadeTypewriter.ttf");
//使用字体
textView.setTypeface(typeFace);
- Action Bar(title文字大小问题 基本运用)
- android 去除title bar 标题栏 action bar
- Android 自定义title 之Action Bar
- 自定义title bar冲突问题
- action bar 的问题
- 工具栏(Action Bar)
- Action Bar(工具栏)
- Action Bar(译)
- openframeworks设置title bar标题图标问题
- 修改 Android 标题栏(Title Bar)
- Android自定义title bar(标题栏)
- Android自定义title bar(标题栏)
- Action Bar(操作栏)
- Action Bar(操作栏)
- Action Bar
- Action Bar
- Action Bar
- Action Bar
- 经典的Java基础面试题
- 星号图
- PHP异常处理方法
- hdu 3974 Assign the task(线段树+将树映射到区间)
- 顺序栈
- Action Bar(title文字大小问题 基本运用)
- OC2-1
- Ajax初步学习
- android 了解你的APP如何使用内存
- 微信公众平台之模拟登录
- hdoj 1068 Girls and Boys 【匈牙利算法&&二分图匹配】
- poj2533 Longest Ordered Subsequence(最长上升子序列)
- switch case语句
- 前几篇文章基于的大数据环境说明