Giter Club home page Giter Club logo

Comments (6)

roubachof avatar roubachof commented on June 30, 2024

Hi John! I'm afraid this sample won't work with download as zip feature cause it has sub modules. You need to get it with a gut client with fork or gitkraken....

from xamarin-forms-practices.

john-dalsgaard avatar john-dalsgaard commented on June 30, 2024

Ok, thanks....

I'm really just trying to see how little I need to implement to obtain this layout:

image

The bottom tabs I already have working - so not sure I'll change that (at first, anyway) - but need a simple way to obtain the views with top tabs (with the underlining) as per the image :-)

But it is a little difficult just looking at your code to find out what I need. I'm also using Prism for MVVM and navigation - and not sure how much that would interfere with your code.

But I really think that your code looks great - I should just have found it earlier...

from xamarin-forms-practices.

john-dalsgaard avatar john-dalsgaard commented on June 30, 2024

... I can see that you use a Grid for laying out the tabbar and the content area - but where do the tab titles come from???

from xamarin-forms-practices.

john-dalsgaard avatar john-dalsgaard commented on June 30, 2024

I tried to clone it using SourceTree.... It didn't bring down the the missing bits and pieces.

So now I have forked it - and clone it using the URL in SourceTree:

image

I also tried to tick "Recurse submodules".... But still see the same missing parts as in the first screen shot. What was it that I did not understand from your suggestion???

from xamarin-forms-practices.

john-dalsgaard avatar john-dalsgaard commented on June 30, 2024

Found a solution. Cannot make the cloned project work - but had another sample that I could make work - and then start playing with (although it stopped working when I updated this package from v.1.1.0 to v.1.3.0 - but that is another story)

from xamarin-forms-practices.

john-dalsgaard avatar john-dalsgaard commented on June 30, 2024

Hmmm... obviously, there was a breaking change in v.1.3.0 :-)

But... moving the tab items inside the TabHostView.Tabs does not solve it. The content from the pages does not show... Edit: (seems to be Android only - does show on iOS)

This is my very simple attempt:

        <StackLayout>
           <Grid RowSpacing="0" ColumnSpacing="0" Margin="0,40,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <tabs:TabHostView BackgroundColor="White"
                                  ShadowType="Bottom"
                                  SelectedIndex="{Binding Source={x:Reference Switcher}, Path=SelectedIndex, Mode=TwoWay}"
                                  Grid.Row="0">
                    <tabs:TabHostView.Tabs>
                        <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="Tab 1" />
                        <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="Tab 2" />
                        <tabs:UnderlinedTabItem Style="{StaticResource TabStyle}" Label="Tab 3" />
                    </tabs:TabHostView.Tabs>
                </tabs:TabHostView>

                <ScrollView Grid.Row="1">
                    <tabs:ViewSwitcher Animate="True" SelectedIndex="{Binding SelectedViewModelIndex, Mode=TwoWay}">
                        <views:Tab1View />
                        <customViews:LazyView x:TypeArguments="views:Tab2View" />
                        <customViews:LazyView x:TypeArguments="views:Tab3View" />
                    </tabs:ViewSwitcher>
                </ScrollView>
            </Grid>
        </StackLayout>

Can anyone nail the problem?

Edit: Hmmm.... There seems to be an issue with the binding context... In the code-behind I have a simple property SelectedViewModelIndex - but it does not get called. And setting the default tab to open doesn't seem to work either. I guess that could be related.
I'll try and add the functionality in my real app running with a proper MVVM and see if the bindings then work at expected. Ignore this....

from xamarin-forms-practices.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.