Я хотел бы, чтобы мой TabBar имел возможность показывать, есть ли больше пунктов меню слева или справа. В противном случае пользователь может не знать, что существуют дополнительные параметры. Что-то вроде стрелок для обозначения большего количества элементов или даже какого-то скошенного эффекта на последнем видимом элементе вкладки, чтобы он предлагал больше параметров за пределами экрана. Вот как выглядит мой TabBar со стрелкой, показывающей, что другие элементы просто обрезаны:
Вот код TabBarSkin:
public class ScollingTabBarSkin extends TabbedViewNavigatorTabBarSkin
{
public var scroller:Scroller;
/**
* Override createChildren() to create a Scroller and add the DataGroup
* as its viewport.
*/
override protected function createChildren():void
{
super.createChildren();
// use a standard HorizontalLayout instead of a specialized layout
var tabLayout:HorizontalLayout = new HorizontalLayout();
tabLayout.useVirtualLayout = false;
tabLayout.gap = 0;
tabLayout.variableColumnWidth = false;
tabLayout.columnWidth = 400;
dataGroup.layout = tabLayout;
scroller = new Scroller();
scroller.setStyle('interactionMode', InteractionMode.TOUCH);
scroller.viewport = dataGroup;
addChild(scroller);
}
/**
* Size and position the Scroller
*/
override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
{
setElementPosition(scroller, 0, 0);
setElementSize(scroller, unscaledWidth, unscaledHeight);
}
}