上一页 1 ··· 5 6 7 8 9 10 11 下一页
摘要: ①创建工程②编写布局 main.xml③新加 drawable.xml,其中添加一个 white 颜色值#ffffffff④在代码中由 ID 获取 TextViewTextView text_A=(TextView)findViewById(R.id.TextView01);TextView text_B=(TextView)findViewById(R.id.TextView02);⑤获取 Resources 对象Resources myColor_R=getBaseContext().getResources();⑥获取 Drawable 对象Drawable myColor_D=myCo 阅读全文
posted @ 2013-12-21 09:30 爱编程hao123 阅读(323) 评论(0) 推荐(0) 编辑
摘要: import android.graphics.drawable.Drawable;import android.content.res.Resources;public void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);TextView text=(TextView)findViewById(R.id.name);//由ID获得资源Resources myColor=getBaseContext().getResources(); 阅读全文
posted @ 2013-12-20 17:24 爱编程hao123 阅读(1003) 评论(0) 推荐(0) 编辑
摘要: 在 values 文件夹中定义一个 drawable.xml 文件 用来存放颜色值#FFFFFF#938192#7cd12e修改 main.xml 中的屏幕背景颜色和 TextView 的字体颜色 阅读全文
posted @ 2013-12-20 17:18 爱编程hao123 阅读(320) 评论(0) 推荐(0) 编辑
摘要: tv_yellow.setText("yellow"); //设置texttv_yellow.setTextColor(Color.YELLOW); //设置文本颜色tv_yellow.setTextSize(29.0f); //设置字体大小tv_yellow.setTypeface(Typeface.SERIF,Typeface.ITALIC); //设置字体名和类型 比如:宋体并倾斜 阅读全文
posted @ 2013-12-20 15:56 爱编程hao123 阅读(674) 评论(0) 推荐(0) 编辑
摘要: 字体风格 Typeface 种类int Style 类型BOLD 粗体BOLD_ITALIC 粗斜体ITALIC 斜体NORMAL 普通字体Typeface 类型DEFAULT 默认字体DEFAULT_BOLD 默认粗体MONOSPACE 单间隔字体SANS_SERIF 无衬线字体SERIF 衬线字体Typeface.create(Typeface family,int style)创建一个混合型新的字体:有 4*5 中搭配Typeface.setTypeface (Typeface tf, int style)设置一个混合型字体:有 4*5 中搭配Typeface.setTypeface(T 阅读全文
posted @ 2013-12-20 15:45 爱编程hao123 阅读(535) 评论(0) 推荐(0) 编辑
摘要: package com.example.ok4;import android.os.Bundle;import android.app.Activity;import android.view.Menu;import android.widget.LinearLayout;import android.widget.TextView;import android.graphics.Color;public class MainActivity extends Activity {private LinearLayout linearlayout; //声明LinearLayoutprivate 阅读全文
posted @ 2013-12-20 15:30 爱编程hao123 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Color.BLACK 黑色Color.BLUE 蓝色Color.CYAN 青绿色Color.DKGRAY 灰黑色Color.GRAY 灰色Color.GREEN 绿色Color.LTGRAY 浅灰色Color.MAGENTA 红紫色Color.RED 红色Color.TRANSPARENT 透明Color.WHITE 白色Color.YELLOW 黄色 阅读全文
posted @ 2013-12-20 14:23 爱编程hao123 阅读(694) 评论(0) 推荐(0) 编辑
摘要: 设置文本超连接 阅读全文
posted @ 2013-12-20 11:05 爱编程hao123 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-12-20 10:51 爱编程hao123 阅读(751) 评论(0) 推荐(0) 编辑
摘要: 一、MediaPlayer mp = new MediaPlayer();接着可以用下面两种方式来指定资源文件(1)mediaplayer.setDataSource("/sdcard/oppo.mp3"); //OK(2)mediaplayer.setDataSource("http://mms.3bu.com/ring/ring/200808151615132.mp3");//OK这种方法在启动mp时,需要 先 mp.prepare(); 再 mp.start();Android通过控制播放器的状态的方式来控制媒体文件的播放,其中:prepare() 阅读全文
posted @ 2013-12-20 10:24 爱编程hao123 阅读(6442) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 下一页