According to the documentation for WL.TabBar.addItem regarding the title parameter:

WL.TabBar.addItem(id, callback, title, options);

title   Mandatory string. The title of the tab. If null is passed, no title is displayed.

However, if I pass the value null like this:

WL.TabBar.addItem("myId", function(){ ... }, null, { ... }); 

I get this error:

Invalid invocation of method WL.TabBar.addItem; Invalid value 'null' (object), expected type 'string'.

And if I pass an empty string " ", I don't see the title but there's empty spacing at the bottom, below the icon.

有帮助吗?

解决方案

Well, it's clearly a bug... :)
I have opened a defect. Thanks!

If what you want to do is to center-align the icon in the tab when there is no text involved, then adding the following to your Android environment's .css file will suffice:

.tabSpan {
   background-position:center; 
}

In addition, and if required, you can also play with the icon dimensions.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top