1、自定义style
2、使用方法:
buttonWhat.setOnClickListener(new OnClickListener() { @Override
public void onClick(View v) {
// TODO Auto-generated method stub
Dialog dialog = new Dialog(activate.this, R.style.ShakeDialog); // Setting the title and layout for the dialog
TextView tv = new TextView(ctxt);
tv.setTextSize(20f);
tv.setText("授权码由⼤写的英⽂文字⺟母组成(A-Z)"); dialog.setContentView(tv);
dialog.show();
}
});
3、抖动效果(抖动4次)xml文件如下:
shake.xml
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="500"
android:fromXDelta="-10"
android:interpolator="@anim/cycle_4"
android:toXDelta="10" />
cycle4.xml
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:cycles="4" />
demo链接:http://pan.baidu.com/s/1kT9oWdD
参考:
1、http://*.com/questions/9305581/how-to-make-a-dialog-slide-from-bottom-to-middle-of-screen-in-android