use*_*318 8 android phonegap-plugins cordova
我在config.xml中有这个
<preference name="show-splash-screen-spinner" value="true" />
Run Code Online (Sandbox Code Playgroud)
和整流器的伟大工程,但我需要从改变位置center,以类似center + 10%垂直
这有什么办法吗?
你必须在 github 上 fork 原始的 cordova-plugin-splashscreen
然后在你的 config.xml 上将其更改为使用你的 fork,删除原始插件(类似<plugin name="cordova-plugin-splashscreen" source="npm" />)并添加你的 fork<plugin spec="https://github.com/youruser/cordova-plugin-splashscreen.git" />
您必须更改此行才能执行您想要的操作 https://github.com/apache/cordova-plugin-splashscreen/blob/master/src/android/SplashScreen.java#L355-L370
现在它以对话框为中心,我不太确定如何完成你想要的,你必须弄清楚 Android 布局是如何工作的
您可以尝试使用 setY 因为 ProgressBar 是 View 子类,如下所示:
DisplayMetrics displaymetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
int height = displaymetrics.heightPixels;
float position = (float) (height*0.4);
progressBar.setY(position);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
969 次 |
| 最近记录: |