标题栏

标题栏

9 人关注该话题

请问怎么获取页面的navigationBarTitleText 标题栏 uni_app

分类: uni-app DCloud_UNI_WZF 2022-09-13 10:33  回复问题 • 1 人关注 • 1 个回复 • 403 次浏览

标题半透明问题 标题栏

分类: HBuilderX 8***@qq.com 2020-07-03 14:33  发起问题 • 1 人关注 • 0 个回复 • 408 次浏览

可以在小程序中使用吗 标题栏

分类: uni-app nimo997 2020-04-10 13:25  回复问题 • 1 人关注 • 1 个回复 • 364 次浏览

自定义标题栏时,ios顶部显示了当前路径,怎么处理? 标题栏 bug已修复

分类: HBuilderX DCloud_heavensoft 2020-04-07 17:35  回复问题 • 2 人关注 • 2 个回复 • 570 次浏览

支付宝生活号标题返回之后不发生改变还是上一页的标题 标题栏 支付宝

分类: uni-app y***@qq.com 2020-01-02 12:09  回复问题 • 2 人关注 • 2 个回复 • 918 次浏览

WebviewTitleNViewStyles标题栏控件固定高度为44px,怎么自定义修改高度? 标题栏

分类: HTML5+ LLgg 2019-12-03 22:30  发起问题 • 2 人关注 • 0 个回复 • 803 次浏览

MUI 自带标题栏怎么取消, titleNView mui 标题栏

分类: MUI 1***@qq.com 2019-11-25 19:18  回复问题 • 6 人关注 • 5 个回复 • 1759 次浏览

求助!!!! 微信H5 模式下动态修改title属性的问题 标题栏 微信h5

分类: uni-app 程咬金3斧头 2019-11-05 14:16  回复问题 • 3 人关注 • 2 个回复 • 1863 次浏览

编译h5,网页的标签页的图标怎么修改 h5 标题栏

分类: uni-app 大家的京酱 2019-11-01 16:45  发起问题 • 1 人关注 • 0 个回复 • 1070 次浏览

wap2app 怎么隐藏或去掉内容页标题栏? 标题栏

分类: wap2app 赢无翳 2019-09-27 20:29  回复问题 • 2 人关注 • 1 个回复 • 982 次浏览

原生标题栏titleNView 自定义返回按钮的点击事件怎么设置 h5+ 标题栏 titleNView

分类: HTML5+ / Native.js 5***@qq.com 2019-08-26 10:11  回复问题 • 1 人关注 • 1 个回复 • 1890 次浏览

更多...
2

赞同来自: Neil_HL Trust

```javascript
var newsView = plus.nativeObj.View.getViewById('tabBar2');
// 绘制小圆点
newsView.drawRect({color:'#f00',radius:'50%'},{... 显示全部 »
```javascript
var newsView = plus.nativeObj.View.getViewById('tabBar2');
// 绘制小圆点
newsView.drawRect({color:'#f00',radius:'50%'},{top:8, left: '35%', height: 6, width:6},'newsPoint');
// 更新小圆点 将颜色设为透明
newsView.drawRect({color:'rgba(255,0,0,0)',radius:'50%'},{top:6, left: '33%', height: 8,width:8},'newsPoint');
```
采用重新绘制的方法,更新方法可以将颜色设为透明,也可以将大小调为0来达到隐藏效果。
以上示例基于[原生控件绘制tab选项卡](http://ask.dcloud.net.cn/article/12602)中的消息id操作。你可以根据此原理做相应调整
1

赞同来自: Trust

我研究了一下MUI源码,源码里直接是写死的`backgroundColor`,而且也并没有暴露出回调入口,也并没有可以外部重写的方式。
估计这问题官方也没啥答复,所以刚刚我把源码改了,亲测有效,现把改动贴出来给有同样问题的童鞋参考:

``` js
var T... 显示全部 »
我研究了一下MUI源码,源码里直接是写死的`backgroundColor`,而且也并没有暴露出回调入口,也并没有可以外部重写的方式。
估计这问题官方也没啥答复,所以刚刚我把源码改了,亲测有效,现把改动贴出来给有同样问题的童鞋参考:

``` js
var Transparent = function(element, options) {

...

// 约 8077 行,Transparent构造函数内
this._style = this.element.style;
this._bgColor = this._style.backgroundColor;
this._opacity = this._style.opacity ? +this._style.opacity : 0;
var color = getColor(mui.getStyles(this.element, 'backgroundColor'));
if (color.length) {
this._R = color[0];
this._G = color[1];
this._B = color[2];
this._A = parseFloat(color[3]);
this.lastOpacity = this._A;
} else if (this._opacity === 1) {
throw new Error("元素背景颜色必须为RGBA");
}
this._bufferFn = $.buffer(this.handleScroll, this.options.duration, this);
this.initEvent();

...

// Transparent.prototype.handleScroll
Transparent.prototype.handleScroll = function(e) {
var y = window.scrollY;
if (!this.isNativeScroll && e && e.detail) {
y = -e.detail.y;
}
switch (this.options.transProp) {
case 'opacity':
var opacity = (y - this.options.top) / this.options.offset + this._opacity;
opacity = Math.min(Math.max(this._opacity, opacity), 1);
this._style.opacity = opacity;
if (opacity > this._opacity) {
this.element.classList.add(CLASS_ACTIVE);
} else {
this.element.classList.remove(CLASS_ACTIVE);
}
break;
case 'backgroundColor':
default:
var opacity = (y - this.options.top) / this.options.offset + this._A;
opacity = Math.min(Math.max(this._A, opacity), 1);
this._style.backgroundColor = 'rgba(' + this._R + ',' + this._G + ',' + this._B + ',' + opacity + ')';
if (opacity > this._A) {
this.element.classList.add(CLASS_ACTIVE);
} else {
this.element.classList.remove(CLASS_ACTIVE);
}
break;
}
if (this.lastOpacity !== opacity) {
$.trigger(this.element, 'alpha', {
alpha: opacity
});
this.lastOpacity = opacity;
}
};

...

// Transparent.prototype.destory
Transparent.prototype.destory = function() {
this.scrollByElem.removeEventListener('scroll', this._bufferFn);
this.scrollByElem.removeEventListener($.EVENT_MOVE, this._bufferFn);
if (this._bgColor) this.element.style.backgroundColor = this._bgColor;
if (this._opacity) this.element.style.opacity = this._opacity;
this.element.mui_plugin_transparent = null;
};

```

调用方式(只需要加一个名为`transProp`的参数即可):
``` js
mui(XXElement).transparent({
offset: 120,
transProp: 'opacity' // 可选值:'opacity','backgroundColor'。默认:'backgroundColor'
})
```
更多...

titleNView配置 - wap2app教程 wap2app 导航栏 标题栏

分类: wap2app 9***@qq.com2023-05-17 10:53  评论文章 • 45 个评论 • 86867 次浏览

微信小程序动态获取标题栏高度 微信小程序 标题栏

分类: uni-app 以何为家2021-05-27 17:46  评论文章 • 1 个评论 • 4786 次浏览

更多...