类似AdressBar 效果的实现,地址 + 转动的图片
1. TextView 方法 :
/**
* Sets the Drawables (if any) to appear to the left of, above,
* to the right of, and below the text. Use null if you do not
* want a Drawable there. The Drawables must already have had
* {@link Drawable#setBounds} called.
*
* @attr ref android.R.styleable#TextView_drawableLeft
* @attr ref android.R.styleable#TextView_drawableTop
* @attr ref android.R.styleable#TextView_drawableRight
* @attr ref android.R.styleable#TextView_drawableBottom
*/
public void setCompoundDrawables(Drawable left, Drawable top,Drawable right, Drawable bottom) {....}
2.
AnimationDrawable
AnimationDrawable mCircularProgress = (AnimationDrawable) resources.getDrawable(R.drawable.browser_loading_anim);
TextView mtitle = new TextView();
//为TextView 右侧加Drawable .
title.setCompoundDrawables(null, null, mCircularProgress,null);
//根据动态加载进程控制图片
void setProgress(int newProgress) {
if (newProgress >= mProgress.getMax()) {
mTitle.setCompoundDrawables(null, null, null, null);
mCircularProgress.stop();
} else {
if (getWindowToken() != null) {
//注:多次调用mCircularProgress.start(),图片会不停滞,原因继续调查。
if(mCircularProgress.isRunning()) {
mTitle.setCompoundDrawables(null, null, null, null);
mCircularProgress.stop();
}
mTitle.setCompoundDrawables(null, null, mCircularProgress,null);
mCircularProgress.start();
}
}
}
3.Animation-list
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/item_1" android:duration="200" />
<item android:drawable="@drawable/item_2" android:duration="200" />
<item android:drawable="@drawable/item_3" android:duration="200" />
<item android:drawable="@drawable/item_4" android:duration="200" />
</animation-list>
以上
Consuela
20110323
分享到:
相关推荐
3、TextView.setCompoundDrawables(left, top, right, bottom) 1、TextView使用ImageSpan显示图片 ImageSpan span = new ImageSpan(this, R.drawable.ic_launcher); SpannableString spanStr = new SpannableString...
DrawableTextView.zip,自定义控件 :drawable 跟随TextView居中 The drawable follows the text centered
Android所有系统资源图标android.R.drawable.xxx查看软件 源码地址:http://blog.csdn.net/dianyueneo/article/details/7197067
查看android.R.drawable图片。点击并显示出名称 UTF-8 android2.2~android4.2
deadline/DrawableTextView.java res/values/attrs.xml ###代码中这样设置即可 drawable = ContextCompat.getDrawable(getContext(), R.mipmap.xxx); setDrawable(DrawableTextView.LEFT, drawable, width, height)...
Android系统图标android.R.drawable下的所有图标查看软件
drawable.doc drawable.doc drawable.doc drawable.doc drawable.doc
slideshowImageView.setImages(R.drawable.test1, R.drawable.test2, R.drawable.test3); For adding images slideshowImageView.addImages(R.drawable.test3, R.drawable.test4, R.drawable.test5); Sample ...
importandroid.graphics.drawable.Drawable; importandroid.graphics.drawable.StateListDrawable; importandroid.os.Bundle; importandroid.view.View; importandroid.widget.Button; public class ...
ListViewTest1 fruits.add(new Fruit("苹果", R.drawable.apple_pic, 3.0f, 200)); fruits.add(new Fruit("香蕉", R.drawable.banana_pic, 3.0f, 200)); fruits.add(new Fruit("桔子", R.drawable.orange_pic, ...
SVG2MrVector 基于库将 *.svg 转换为可绘制矢量和 Mr.Vector 可绘制
Android-android-gif-drawable.zip,在android上显示动画gif的视图和绘图,安卓系统是谷歌在2008年设计和制造的。操作系统主要写在爪哇,C和C 的核心组件。它是在linux内核之上构建的,具有安全性优势。
// []{R.drawable.a,R.drawable.b,R.drawable.c,R.drawable.d,R.drawable.e,R.drawable.f,R.drawable.g,R.drawable.h,R.drawable.i,R.drawable.j},true); // mAnimation = new Animation(mContext,new int // []{...
private int[] icon={R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_launcher, R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_launcher,R.drawable.ic_...
R.drawable.img_12, R.drawable.img_13, R.drawable.img_14, R.drawable.img_15}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super....
Nodrawable是一个旨在减少99%的drawable.xml文件的库,可直接在布局文件中对任意View声明drawable属性。 方案原理:一种巧妙的drawable.xml替代方案 演示Demo:一种巧妙的drawable.xml替代方案-效果篇 特性 ① 成本...
.setImages(new int[]{R.drawable.new_user_guide_1, R.drawable.new_user_guide_2, R.drawable.new_user_guide_3, R.drawable.new_user_guide_4}) .show(getFragmentManager()); API API 释义 ...
imageView.placeholder = resources.getDrawable(R.drawable.placeholder) imageView.source = imageUrl // Url or drawable Using Mural Builder Mural.with(this) .placeholder(R.drawable.placeholder) .source...
ad.add(R.drawable.a1); ad.add(R.drawable.a2); ad.add(R.drawable.a3); ad.add(R.drawable.a4); ad.add(R.drawable.a5); ad.add(R.drawable.a6); ad.add(R.drawable.a7); ad.add(R....
img1.setBackgroundResource(R.drawable.a1); advPics.add(img1); ImageView img2 = new ImageView(this); img2.setBackgroundResource(R.drawable.a2); advPics.add(img2); ImageView img3 = new...