You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/04 02:50:12 UTC

[GitHub] [cordova-plugin-splashscreen] niczm25 commented on issue #193: Splash Screen Spinner Position

niczm25 commented on issue #193: Splash Screen Spinner Position
URL: https://github.com/apache/cordova-plugin-splashscreen/issues/193#issuecomment-549210345
 
 
   > Thanks @pedrovitor074.
   > 
   > You could just add a hook and set the position then:
   > 
   > (Attention: That's just super quick and dirty..)
   > 
   > **config.xml:**
   > 
   > ```
   > <platform name="ios">
   >     <hook src="hooks/after_build/after_build_modify_ios_spinner_position_action.js" type="after_build" />
   > </platform>
   > ```
   > 
   > **after_build_modify_ios_spinner_position_action.js**
   > 
   > ```js
   > #!/usr/bin/env node
   > 
   > module.exports = function (context) {
   >     console.log("Preparing iOS spinner position correction");
   >     const fs = context.requireCordovaModule('fs');
   >     const pathToProject = 'platforms/ios/YOUR_PROJECT_NAME/Plugins/cordova-plugin-splashscreen/CDVSplashScreen.m';
   >     const pathToCDVSplashScreenFile = `${context.opts.projectRoot}/${pathToProject}`;
   > 
   >     fs.access(pathToCDVSplashScreenFile, fs.F_OK, (err) => {
   >         if (err) {
   >             console.error(err);
   >             return;
   >         }
   > 
   >         const dataRead = fs.readFileSync(pathToCDVSplashScreenFile, 'utf8');
   >         const newData = dataRead.replace('_activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2);', '_activityView.center = CGPointMake(parentView.bounds.size.width / 2, parentView.bounds.size.height / 2 + 50);');
   > 
   >         fs.writeFileSync(pathToCDVSplashScreenFile, newData, 'utf8');
   >         console.log("Done preparing iOS spinner position");
   >     });
   > };
   > ```
   > 
   > Make sure you replace the `YOUR_PROJECT_NAME`.
   > Would be much better if someone would create a pull request and having the positions just in the config.xml file. But right now this works for me
   
   Do you have this for Android Platform? Thank you in advance

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org