Android 隐藏软键盘、进出动画、图片进行缩放

来源:互联网 发布:足球球员数据统计表格 编辑:程序博客网 时间:2024/05/22 03:44

一、我们很多时候会用到隐藏键盘的时候 。

如何去实现:

InputMethodManager inputMsg = (InputMethodManager) LXApplication.getInstance().getSystemService(Context.INPUT_METHOD_SERVICE);if (inputMsg.isActive()) { // 隐藏软键盘    if (getCurrentFocus()!= null) {        inputMsg.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);    }}

二、我们通常会给Activity添加启动动画。

如何实现:

//复写 Activity的转度动画  
//R.anim.start  开启动画
//R.anim.end    结束动画
overridePendingTransition(R.anim.start, R.anim.end);
三、我们会看到有时候我们需要对图片进行手势的放大缩小

如何实现:  使用HackyViewPager

<com.senab.photoview.HackyViewPager    android:id="@+id/pager"    android:layout_width="match_parent"    android:layout_height="match_parent"     />

1 0
原创粉丝点击