【报Bug】uni-app(android系统下自定义基座,ios未测)设置原生导航栏按钮监听事件(onNavigationBarButtonTap)无效。

参考文档:http://ask.dcloud.net.cn/question/66571

【仅APP会出问题,h5不会出问题】问题产生的原因:自定义按钮的fontSize属性使用了upx单位就会导致问题。

fontSize设置px单位就成功了【切记:APP修改了pages.json文件一定要重启,否则看不到效果!】

           {
             "path" : "pages/search/search",
            "style": {
            	"navigationBarTitleText": "搜索页",
            	"app-plus":{
            		"titleNView":{
						"autoBackButton":false,
            			"buttons":[{
            				"text":"取消",
            				"float":"right",
            				"fontSize":"14px"
            			}],
            			"searchInput":{
            				"autoFocus":true,
            				"placeholder":"搜索糗事",
            				"borderRadius":"10px",
            				"backgroundColor":"#F5F4F4"
            			}
            		},
            		"scrollIndicator":"none"
            	}
            }

建议uni-app中单位全部用px,因为很多动态解析的upx会无效,出现很多隐形的问题,而你使用px单位,静态hbuilder可以设置自动转换upx的

猜你喜欢

转载自blog.csdn.net/weixin_43343144/article/details/89947688