Comments (2)
I solved this problem I had by building a PageControl
element like @esikmalazman did it in SwiftUI-UIPageControl
And this element I put now below the Pager { ... }
, so my code looks in the end like this:
VStack {
// 'currentPage' is a '@StateObject' defined outside the `var body: some View { }` -> `@StateObject var currentPage = Page.withIndex(0)`
Pager(page: currentPage, data: items, id: \.self) { item in
MyView(item: item)
}
.sensitivity(.high)
.preferredItemSize(CGSize(width: CONST_FOR_WIDTH, height: CONST_FOR_HEIGHT))
.itemSpacing(12)
// Pager element to have the page indicator
PageControl(currentPageIndex: currentPage.index, numberOfPages: items.count).padding(.bottom, 20)
}
My colleague @sebbu gave me this tip, by moving my thoughts to UIPageControl
. This UIKit element is used for UIKit pager elements and can be easily rebuild into SwiftUI.
But is there a way to please integrate the PageControl to this library and be able to enable it by a ViewModifier
from swiftuipager.
I think a PageControl
is out of the scope of the library. I leave this to the user to implement if desired
from swiftuipager.
Related Issues (20)
- [BUG] Weird moving transparent Image appearing when scrolling fast.
- [BUG] tvOS NavigationLink not work HOT 1
- [FEAT] Hide scroll indicator on watchOS
- [BUG] To many pageView request
- [BUG] The element inside of Pager is hidden when when it goes beyond the screen border
- Pager not shown when using inside ScrollView HOT 3
- Pager Size according to the inner view
- [BUG] App Crashes detected HOT 2
- [BUG] Cant swipe, the page goes back to first
- [BUG] Item's with different size does not work as expected for swipeDirection vertical
- Auto Scroll horizontally one item at a time when user is not interacting
- [FEAT] Ability to not clip children HOT 1
- Multiple Page nesting causes sliding bug
- [FEAT] .dragBackwardsOnly() ? HOT 1
- [BUG] macOS 14 displays focusRing HOT 2
- [FEAT] The anchor point for interactive scaling
- [FEAT] Interactive Blur Effect
- [BUG] Pager scrolls in the opposite direction in RLT languages
- [FEAT] Do not deallocate page when scrolling to next page
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 swiftuipager.