編輯:關於Android編程
(不會做動態圖,齒輪其實一直在轉動)
基本代碼如下:
1. Activity的布局文件:
[html]
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/gear_iv"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/gear" />
</RelativeLayout>
2.anim的配置文件
[html]
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="3000"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:interpolator="@android:anim/linear_interpolator" />
3.Activity實現:
[java]
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initGear();
}
private void initGear() {
RotateAnimation gearAnim = (RotateAnimation) AnimationUtils.loadAnimation(this, R.anim.running_gear);
ImageView gearIV = (ImageView) findViewById(R.id.gear_iv);
gearIV.startAnimation(gearAnim);
}
}
Android設置裡面默認存儲器選項(default write disk)的實現
原生的Android設置裡面沒有默認存儲器的選項,但是MTK偏偏加上了這個功能,可能MTK覺得這個比較有用吧,所以,他們在原生的基礎上面做了修改,加上了這個功能
ViewGroup的dispatchTouchEvent理解
以下圖例子說明,OFramelayout在最外層 圖1.1 view的層級關系結論1:dispatchTouchEvent()返回false,後續的ACTION_M
Android Studio 打包apk,自動追加版本號和版本名稱
默認AS大包好的apk是app-deubg.apk的,這樣的話版本多了找出一個bug在哪個版本中存在的,就非常的麻煩了,我們追加版本號和版本名稱後就非常好區分了。配置方法
新浪微博如何解綁手機 新浪微博會員怎麼解綁手機 新浪微博會員手
當我們為新浪微博的登陸設置了賬號保護、手機綁定之後,便將新浪微博賬號的安全與我們的手機號聯系起來了。由於換號或者其它原因,我們需要解除綁定的時候該怎麼辦呢?