小可爱

uni-app导航栏搜索框让默认的搜索文章搜索图标距离左边

电脑版发表于:2022/2/15 14:30


uni-app导航栏搜索框让默认的搜索文章搜索图标距离左边很简单有一个属性可以设置,"align":"left"即可

完整一点的代码如下:

{
    "path": "pages/index2/index2",
    "style": {
        "navigationBarTitleText": "",
        "enablePullDownRefresh": false,
        "app-plus": {
            "titleNView": {
                "titleColor": "#fff",
                "backgroundColor": "#007AFF",
                "searchInput": {
                    "backgroundColor": "#fff",
                    "borderRadius": "6px",
                    "placeholder": "请输入如net core",
                    "disabled": true,
                    "align":"left"
                }
            }
        }
    }
}
更多属性:

earchInput支持以下属性
    autoFocus: Boolean类型,搜索框是否自动获取焦点,默认值为false
    align: String类型,非输入状态下文本的对齐方式,可取值"left"、"right"、"center",默认值为"center"
    borderRadius: String类型,输入框的圆角半径,取值格式为"XXpx",其中XX为像素值(逻辑像素),如"10px"表示10像素半径圆角, 默认值为"0px",即无圆角
    placeholder: String类型,提示文本,搜索框未中输入内容为空时显示的文本内容
    placeholderColor: String类型,提示文本颜色,格式为"#RRGGBB"或"rgba(R,G,B,A)",默认值为"#CCCCCC"
    disabled: Boolean类型,是否禁止输入,禁止输入搜索框则无法获取焦点,点击编辑框触发"onNavigationBarSearchInputClicked"事件,默认值为false


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢