qibin0506 / AutoHideIME

快速实现点击任意位置收缩键盘

Home Page:http://blog.csdn.net/qibin0506

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutoHideIME

快速实现收缩键盘

在实际项目中是不是有很多这样的需求:点击屏幕中除EditText任意位置收缩键盘。

遇到这样的需求是不是总是很无奈?

AutoHideIME帮助你快速实现这样的需求。

效果展示

如何使用

android studio用户在gradle配置中加入:

compile 'org.loader:autohideime:1.0'

在Activity中使用, 仅仅一句话就可以搞定:

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        HideIMEUtil.wrap(this);
    }
}

在Fragment中使用, 依然一句话:

public class MyFragment extends Fragment {

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        HideIMEUtil.wrap(this);
    }
}

About

快速实现点击任意位置收缩键盘

http://blog.csdn.net/qibin0506

License:Apache License 2.0


Languages

Language:Java 100.0%