uni-app判断机型

1:使用Hbuilderx 3.5.3版本

2:在uni-app开发中 需要判断ios或者android 做出不同操作时的知识点

本人是在键盘弹出影响页面时所用,  在android中 键盘弹出页面会影响页面布局,ios不会

所以使用uni.getSystemInfoSync().platform 来规避

let platform = uni.getSystemInfoSync().platform;
				 if (platform == 'android') {

				 }else{
					return 
				 }
				 

ios系统 :

uni.getSystemInfoSync().platform == 'ios'

安卓系统:

uni.getSystemInfoSync().platform == 'ios'

猜你喜欢

转载自blog.csdn.net/weixin_48091030/article/details/126742423
今日推荐