Comments (8)
@amccorma - I'm having trouble replicating this issue. Do you have any additional steps that you can provide?
- Did you change any code?
- Are you testing on an emulator or real device?
- Are your Android SDKs + build tools up to date?
from xamarin-forms-carouselview.
Hi chrisriesgo,
I do have the same issue. The only thing I did to the original code was:
Install-Package Xamarin.Forms -Version 1.5.0.6447
It fails here: HomePage.cs, View CreateTabs(), pagerIndicator.SetBinding(PagerIndicatorTabs.ColumnDefinitionsProperty, "Pages", BindingMode.Default, new SpacingConverter());
I then fell back to
Install-Package Xamarin.Forms -Version 1.4.4.6449
with the same issue.
Only going back to the original version of Xamarin Forms
Install-Package Xamarin.Forms -Version 1.4.2.6359
worked.
Device: Samsung Galaxy S6, Factory reset, nothing installed
SDK: Android SDK 5.1.1 (API22)
Thanks, crisriesgo for looking into this. Maybe my findings help to point in the right direction.
And thanks for the code! :) e862
from xamarin-forms-carouselview.
It has been a long time since I looked at it. I reviewed my solution that fixed the issue. I did a workaround and forgot to post it.
In PagerIndicatorTabs.cs, change ItemsSourceChanged to:
void ItemsSourceChanged ()
{
if (ItemsSource == null) return;this.ColumnDefinitions.Clear ();
foreach(var item in ItemsSource)
{
this.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
}
CreateTabs();
}
In HomePage.cs change:
remove the binding for ColumnDefintions.
Xamarin.Forms.View CreateTabs()
{
var pagerIndicator = new PagerIndicatorTabs() { HorizontalOptions = LayoutOptions.CenterAndExpand };
pagerIndicator.RowDefinitions.Add(new RowDefinition() { Height = 50 });
pagerIndicator.SetBinding (PagerIndicatorTabs.ItemsSourceProperty, "Pages");
pagerIndicator.SetBinding (PagerIndicatorTabs.SelectedItemProperty, >"CurrentPage");
return pagerIndicator;
}
from xamarin-forms-carouselview.
Hi amccorma, and many thanks for quick response!
It works and it saved me quite some time. Greetings, e862
from xamarin-forms-carouselview.
This solution works but the dots/tabs now don't update anymore when swiping. I tested on iOS.
from xamarin-forms-carouselview.
Thank you @amccorma your workaround works perfectly. Tested on Android API 22, iOS 8.4 and 9.2.
@Zilounay you need a help for solve this?
from xamarin-forms-carouselview.
Zilounay: the issue with the dots is the event handler (command is not attached to the button)
In PagerIndicatorTabs.cs find CreateTabs method. at the button create code attach the command:
var tgr = new TapGestureRecognizer();
tgr.Command = new Command(() =>
{
SelectedItem = ItemsSource[index];
});
tab.GestureRecognizers.Add(tgr);
Children.Add(tab, index, 0);
from xamarin-forms-carouselview.
Made some changes based on @amccorma's findings. Closing the issue.
from xamarin-forms-carouselview.
Related Issues (20)
- Xamarin.Forms 2.1 dots crash HOT 1
- Anyone working on porting to UWP? HOT 3
- Xamarin.forms 2.2.0 update HOT 7
- Issue on Android with latest version of Forms 2.2.0.31 HOT 14
- Vertical Orientation Carousel View.
- Slow swipe - System.InvalidOperationException: Sequence contains more than one element HOT 4
- [iOS] Slide to view when SelectedIndex or SelectedItem changed. HOT 1
- Carousel reset only on iOS when device's orientation change HOT 6
- CarouselView Broken on UWP
- No Children Collection
- Adding Images ?
- Issue with Latest Xamarin Forms HOT 1
- Not update if page collection modifed HOT 2
- Update recipe to use Xamarin.Forms.CarouselView
- Navigation issue
- How to get control value from all views? Is it Possible HOT 1
- There is no page indicator
- General use case example missing
- how to use HOT 1
- Nullreference on Android
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-carouselview.