KeyboardHeightProvider:使用覆盖弹出窗口获取android键盘高度

上传者: 42118701 | 上传时间: 2022-04-27 10:11:58 | 文件大小: 147KB | 文件类型: ZIP
键盘高度提供器 在android中获取键盘高度,这是一个痛苦的过程。 对于软输入模式为adjustResize ,您可以设置OnGlobalLayoutListener并测量活动窗口的大小调整方式,以便为键盘腾出空间。 对于软输入模式的其他模式,您不走运。 由于即使经过28次SDK开发,android顽固的负责人也拒绝解决此问题,所以有人提出了一个很酷的解决方案: 创建一个弹出窗口并观察其全局布局更改 将其软输入行为设置为adjustResize 将此弹出窗口附加到您的活动,并根据其布局更改报告键盘高度。 设置 将以下仓库添加到您的项目中 repositories { maven { url " https://dl.bintray.com/crysis21/Android " } } 将以下依赖项添加到您的

文件下载

资源详情

[{"title":"( 46 个子文件 147KB ) KeyboardHeightProvider:使用覆盖弹出窗口获取android键盘高度","children":[{"title":"KeyboardHeightProvider-master","children":[{"title":"gradlew <span style='color:#111;'> 5.17KB </span>","children":null,"spread":false},{"title":"settings.gradle <span style='color:#111;'> 42B </span>","children":null,"spread":false},{"title":"keyboardheightprovider","children":[{"title":"src","children":[{"title":"androidTest","children":[{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"keyboardheightprovider","children":[{"title":"ExampleInstrumentedTest.java <span style='color:#111;'> 753B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"keyboardheightprovider","children":[{"title":"ExampleUnitTest.java <span style='color:#111;'> 393B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 124B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"layout","children":[{"title":"keyboard_popup.xml <span style='color:#111;'> 249B </span>","children":null,"spread":false}],"spread":true},{"title":"values","children":[{"title":"strings.xml <span style='color:#111;'> 85B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"keyboardheightprovider","children":[{"title":"KeyboardInfo.kt <span style='color:#111;'> 514B </span>","children":null,"spread":false},{"title":"KeyboardHeightProvider.kt <span style='color:#111;'> 4.15KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".gitignore <span style='color:#111;'> 7B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 3.46KB </span>","children":null,"spread":false},{"title":"proguard-rules.pro <span style='color:#111;'> 751B </span>","children":null,"spread":false}],"spread":true},{"title":"gradle","children":[{"title":"wrapper","children":[{"title":"gradle-wrapper.properties <span style='color:#111;'> 233B </span>","children":null,"spread":false},{"title":"gradle-wrapper.jar <span style='color:#111;'> 53.06KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"README.md <span style='color:#111;'> 2.55KB </span>","children":null,"spread":false},{"title":"gradlew.bat <span style='color:#111;'> 2.21KB </span>","children":null,"spread":false},{"title":"gradle.properties <span style='color:#111;'> 817B </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 995B </span>","children":null,"spread":false},{"title":"app","children":[{"title":"src","children":[{"title":"androidTest","children":[{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"myapplication","children":[{"title":"ExampleInstrumentedTest.kt <span style='color:#111;'> 648B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"test","children":[{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"myapplication","children":[{"title":"ExampleUnitTest.kt <span style='color:#111;'> 348B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"main","children":[{"title":"AndroidManifest.xml <span style='color:#111;'> 837B </span>","children":null,"spread":false},{"title":"res","children":[{"title":"mipmap-hdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.89KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 4.79KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 8.91KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 14.78KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 4.38KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 6.73KB </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-anydpi-v26","children":[{"title":"ic_launcher.xml <span style='color:#111;'> 270B </span>","children":null,"spread":false},{"title":"ic_launcher_round.xml <span style='color:#111;'> 270B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-mdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 2.01KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 2.72KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable","children":[{"title":"ic_launcher_background.xml <span style='color:#111;'> 4.77KB </span>","children":null,"spread":false}],"spread":false},{"title":"layout","children":[{"title":"activity_second.xml <span style='color:#111;'> 1.03KB </span>","children":null,"spread":false},{"title":"activity_main.xml <span style='color:#111;'> 1.68KB </span>","children":null,"spread":false}],"spread":false},{"title":"drawable-v24","children":[{"title":"ic_launcher_foreground.xml <span style='color:#111;'> 1.92KB </span>","children":null,"spread":false}],"spread":false},{"title":"values","children":[{"title":"colors.xml <span style='color:#111;'> 208B </span>","children":null,"spread":false},{"title":"strings.xml <span style='color:#111;'> 77B </span>","children":null,"spread":false},{"title":"styles.xml <span style='color:#111;'> 383B </span>","children":null,"spread":false}],"spread":false},{"title":"mipmap-xxhdpi","children":[{"title":"ic_launcher.png <span style='color:#111;'> 6.24KB </span>","children":null,"spread":false},{"title":"ic_launcher_round.png <span style='color:#111;'> 10.17KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"java","children":[{"title":"com","children":[{"title":"hold1","children":[{"title":"myapplication","children":[{"title":"MainActivity.kt <span style='color:#111;'> 1.19KB </span>","children":null,"spread":false},{"title":"SecondActivity.kt <span style='color:#111;'> 306B </span>","children":null,"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":".gitignore <span style='color:#111;'> 7B </span>","children":null,"spread":false},{"title":"build.gradle <span style='color:#111;'> 1.11KB </span>","children":null,"spread":false},{"title":"proguard-rules.pro <span style='color:#111;'> 751B </span>","children":null,"spread":false}],"spread":true},{"title":"build.gradle <span style='color:#111;'> 754B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明