Android Oreo - how do I set Adaptive Icons in Cordova?

前端 未结 9 1662
死守一世寂寞
死守一世寂寞 2020-12-24 13:57

Just wondering if anyone been able to set adaptive icons on Cordova for Android Oreo? I\'m using the android 6.4.0 and my square icon shrinks to fit the circle. I just want

9条回答
  •  鱼传尺愫
    2020-12-24 14:57

    I may be late to the party, but I struggled to get this working because (a) using PhoneGap Build, and (b) doing things by hand, not using Android Studio. So, for those playing along at home, here's all I had to do to get adaptive icons working:

    1. Inside in my config.xml, I set:
            
            
            
            
            
            
    
            
            
                
            
    
    1. The PNG files in the config above are self-explanatory. The XML file referenced as ic_launcher.xml and ic_launcher_round.xml are identical, I just created this file at the source location and copied it in via the resource tags above. This is the contents of both of those XML files, reference as the src public/pwa/android/ic_launcher.xml and ic_launcher_round.xml:
    
    
        
        
    
    

    Note I'm targeting phonegap ver 8.1.1 () The post at https://forums.adobe.com/thread/2576077 was helpful in illuminating the fact that you have to use different target paths on your tags, depending on the cli version you are using.

    Hope this helps, hit me with questions if I missed anything. Cheers!

提交回复
热议问题