htmliosnativescriptangular2-nativescriptnstabview

Can I have the iOS Tab View on top in Native Script?


I am creating a native script application and I want my tab View to appear on the top for iOS. I know sticking the tabView on the top violates the human interface guideline, but I need to do it this way.


Solution

  • You can achieve that. Here's how i have done the similar thing -

    <StackLayout row="0" col="0">
    <StackLayout  *ngIf="visibility1" id="mainView" visibility="{{ visibility1 ? 'visible' : 'collapsed' }}">
        <FirstView></FirstView>
    </StackLayout>
    <StackLayout  *ngIf="visibility2" id="mainView" visibility="{{ visibility2 ? 'visible' : 'collapsed' }}">
        <SecondView></SecondView>
    </StackLayout>
    <StackLayout  *ngIf="visibility3" id="mainView" visibility="{{ visibility3 ? 'visible' : 'collapsed' }}">
        <ThirdView></ThirdView>
    </StackLayout>
    </StackLayout>
    

    and change the visibility of each component based on the click events.