我遇到这种情况,我检查软键盘是否打开,我想在代码中解散,当我使用下面的代码时它无法解除键盘,因为代码找不到任何焦点,但键盘仍然打开,所以我怎么能隐藏它?
private void hideSoftKeyboard() {
Activity activity = (Activity) sContext;
View view = activity.getCurrentFocus();
if (view != null) {
InputMethodManager inputMethodManager = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
//((Activity) sContext).getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
} else {
Log.i(sClassTag,"focus not found");
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个 Android 项目,它在 build gradle 2.3.3 中运行良好,当我使用 build gradle 3.0.1 时,我遇到了一些构建错误。这是错误的build.gradle,它的项目名称是A。
apply plugin: 'com.android.library'
apply from: '../Localization/localize.gradle'
apply plugin: 'maven'
......
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode buildVersionCode
versionName buildVersionNumber
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
}
}
ndk{
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
/*abiFilters 'x86', 'x86_64', 'armeabi', 'armeabi-v7a',
'arm64-v8a'*/
abiFilters 'x86','armeabi-v7a'
}
testOptions {
unitTests.returnDefaultValues = true …Run Code Online (Sandbox Code Playgroud) 我正在iOS11中使用PDFKit开发一个可以显示pdf文件添加注释的应用程序。现在我想向pdf页面添加图像注释,我认为注释子类型应该是stamp。但在 PDFKit 中我找不到像“ image”这样的属性来设置,唯一与图章注释相关的属性是stampName。有人可以帮忙吗?