Comments (5)
Are you using the carouselItemWidth delegate method, and if so are you also updating the value returned by this method when you rotate the screen?
Nick
(Sent from my iPhone)
On 20 Jul 2011, at 15:40, rpitting [email protected] wrote:
I am not sure if I'm missing something or it's a feature not implemented:
I have a carousel that uses two different item-sizes for portrait and landscape, with the langscape size being smaller.
Therefore, all items shrink in landscape mode. At the moment I call
layoutSubviews
andreloadData
and indidRotateFromInterfaceOrientation
.Unfortunately, this leads to gaps between the items when rotating the device from portrait to landscape, as the subviews do not seem to be rearranged with the new item size (their anchor point just stays where it was).
So does the component not yet support a variable item size? And if it does, what's the right order of calling
layoutSubviews
etc.?Or is the (animated) change of the item size currently not possible?
Reply to this email directly or view it on GitHub:
https://github.com/demosthenese/iCarousel/issues/18
from icarousel.
Yes, actually returning two different values in the delegate method carouselItemWidth
will work, sorry for this error in my description.
To apply the new size, call reloadData
.
Although, the items are not not animated between their two sizes, they jump. But, I admit, animating the size is quite a custom request.
I guess the best way to do this is to get the visible views via iCarousel.visibleViews
and animate their centers yourself.
Or is there a smarter way?
from icarousel.
This seems like an oversight on my part. I'll see what's involved in adding this feature.
Nick
(Sent from my iPhone)
On 21 Jul 2011, at 09:30, rpitting [email protected] wrote:
Yes, actually returning two different values in the delegate method
carouselItemWidth
will work, sorry for this error in my description.To apply the new size, call
reloadData
.Although, the items are not not animated between their two sizes, they jump. But, I admit, animating the size is quite a custom request.
I guess the best way to do this is to get the visible views via
iCarousel.visibleViews
and animate their centers yourself.Or is there a smarter way?
Reply to this email directly or view it on GitHub:
https://github.com/demosthenese/iCarousel/issues/18#issuecomment-1622121
from icarousel.
I'm having trouble reproducing this issue. It seems to work as expected if you simply call reloadData on didRotateFromInterfaceOrientation and then return views of a different size from your viewForItemAtIndex method. Calling layoutSubviews explicitly shouldn't be necessary, so maybe by calling it you are somehow preventing the layout from working correctly?
If you still can't get it working, post the code you are using and I'll investigate further.
from icarousel.
Actually, I may have misunderstood what you are trying to do. Are you using the view autoresizingmask to scale your views automatically in response to the screen rotation?
If so, there's a fork here that tweaks the autoresizingmask of the container views so they scale automatically:
https://github.com/veritech/iCarousel
If that solves your problem I might look at rolling it into the main branch.
from icarousel.
Related Issues (20)
- ICarousel Accessibility Inspector return incorrect UI element location for Mac
- constraints attribute? for optimizing for device size?
- Crash report from Fabric
- Carousel like glidejs.com
- An unwanted view is displaying first time when we scroll slowly as a background shadow
- How to install
- Can you expose the previousItemIndex
- Spacing between items HOT 1
- Swift Package Manager Support
- On UIButtonClicked Change UIView at particular indexpath in iCarousel
- iCarouselTypeRotary type number of visual images invalid setting
- iCarouselTypeRotary type number of visual images setting invalid
- Carousel inside reusable UITableViewCell, carousel views shuffled
- iOS 13 deprecate in iCarousel.m new warnings due to use of old animation method
- tvos icarousel
- On apps running on Mac OS with Catalyst to move between different item you can't use trackpad gesture but need to press and drag HOT 1
- Delegate and Datasource should be weak? HOT 1
- Cycling custom type animation
- Swift Package Manager support issue
- Scrollable carousel view accessibility Id is not working.
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 icarousel.