Comments (6)
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.
Ok, thanks....
I'm really just trying to see how little I need to implement to obtain this layout:
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.
... 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.
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:
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.
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.
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)
- Fresh clone is missing referenced projects HOT 2
- Unable to fetch: git submodule update --init HOT 3
- HorizontalListView Question
- Can't clone and build Xamarin-Forms-Practices HOT 7
- How to use Pull-to-Refresh like as ListView? HOT 5
- Is it possible to better customize the look and feel of the TabHost and the Tabs? HOT 1
- on select tab it execute many time HOT 1
- Two files name have been inverted
- should mention somewhere that the project doesn't run on its own HOT 2
- The current source does not compile. HOT 19
- git submodule not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamarin-forms-practices.