8***@qq.com
8***@qq.com
  • 发布:2020-07-22 10:56
  • 更新:2020-10-03 17:48
  • 阅读:4780

uniapp中的原生导航,怎么设置边距?

分类:uni-app

pages.json配置如下:

{  
            "path": "pages/tabbar/tabbar-1/tabbar-1",  
            "style": {  
                "navigationBarTitleText": "首页",  
                "app-plus": {  
                    "titleNView": {  
                        "type": "transparent",  
                        "titleColor": "#333333",  
                        "backgroundColor": "#FFFFFF",  
                        "buttons": [{  
                            "fontSrc": "/static/font/iconfont.ttf",  
                            "text": "\ue64d",  
                            "width": "40px",  
                            "fontSize": "24px",  
                            "color": "#817D7D",  
                            "background": "rgba(0,0,0,0)"  
                        }],  
                        "searchInput": {  
                            "backgroundColor": "#F8F8F8",  
                            "borderRadius": "16px",  
                            "placeholder": "搜索",  
                            "placeholderColor": "#817D7D",  
                            "align": "left",  
                            "disabled": true  
                        },  
                        "splitLine": {  
                            "color": "#E7E7E7"  
                        }  
                    }  
                }  
            }  
        }

导航左右2边的边距我想设置和下面内容一致,但是看了api没有找到相关设置边距的字段

2020-07-22 10:56 负责人:无 分享
已邀请:
chenli

chenli

titleNViewStyle
padding: (String 类型 )内边距
标题栏左右的内边距,单位为px(逻辑像素值),如"10px"表示10逻辑像素值。 默认值为"0px"。

padding-right: (String 类型 )右内边距
标题栏右侧内边距,单位为px(逻辑像素值),如"10px"表示10逻辑像素值。 默认值为"0px",优先级padding-right > padding。

padding-left: (String 类型 )左内边距
标题栏左侧内边距,单位为px(逻辑像素值),如"10px"表示10逻辑像素值。 默认值为"0px",优先级padding-left > padding。

迪格立之

迪格立之

"titleNView": {
"padding": "10px",
......
}

该问题目前已经被锁定, 无法添加新回复