现附上参考文章连接:
自定义navigationBar顶部导航栏,兼容适配所有机型(附完整案例) | 微信开放社区developers.weixin.qq.com![2a39725d19677c4f5505fb92a2a02fbd.png](https://img-blog.csdnimg.cn/img_convert/2a39725d19677c4f5505fb92a2a02fbd.png)
下面是我的laya版本:
private m_topMenueRect:_MenueButtonBoundingInfo=null;
public GetMenueBtnTop():_MenueButtonBoundingInfo
{
if (this.m_topMenueRect!=null) {
return this.m_topMenueRect;
}
if (this.AdsSystemInfo==null)
{
this.m_topMenueRect={ //获取不到胶囊信息就自定义重置一个
bottom: 32,
height: 32,
left:Laya.Browser.clientWidth - 98,
right: Laya.Browser.clientWidth - 10,
top: 32,
width: 88
};
return this.m_topMenueRect;
}
try
{
if (Platform.MiniPlatform==null||Platform.MiniPlatform=="undefined")
{
throw 'm_adP