Comments (3)
Do you have a little more context? Have you connected the collection view to a delegate, if so, what's the delegate? Post a little more code and others might be able to help!
from jelly.
@Yonodactyl Hello, I'm very sorry, the following is the supplementary content.
This is the entrance, which can be loaded normally:
let vc = ATHFuncVC()
let uiConfiguration = PresentationUIConfiguration(cornerRadius: 16, backgroundStyle: .dimmed(alpha: 0.3), isTapBackgroundToDismissEnabled: true, corners: [.layerMaxXMaxYCorner,.layerMaxXMinYCorner,.layerMinXMaxYCorner,.layerMinXMinYCorner])
let size = PresentationSize(width: .fullscreen, height: .halfscreen)
let alignment = PresentationAlignment(vertical: .bottom, horizontal: .center)
let timing = PresentationTiming(duration: .medium, presentationCurve: .easeIn, dismissCurve: .easeOut)
let interactionConfiguration = InteractionConfiguration(presentingViewController: self, completionThreshold: 0.5, dragMode: .canvas)
let presentation = CoverPresentation(directionShow: .bottom,
directionDismiss: .bottom,
uiConfiguration: uiConfiguration,
size: size,
alignment: alignment,
marginGuards: .zero,
timing: timing,
spring: .none,
interactionConfiguration: interactionConfiguration)
animator = Animator(presentation:presentation)
animator?.prepare(presentedViewController: vc)
present(vc, animated: true, completion: nil)
This is a subview in ATHFuncVC:
let funcView = ATHFuncView()
funcView.getInfo { (row) in
logger("ATHFuncVC", sub: "funcView", info: "Index: \(row)")
}
self.view.addSubview(funcView)
There is a UICollectionView
in the ATHFuncView
view:
let layout = UICollectionViewFlowLayout.init()
collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
collectionView.backgroundColor = .clear
collectionView.dataSource = self
collectionView.delegate = self
collectionView.allowsSelection = false
collectionView.allowsMultipleSelection = false
collectionView.alwaysBounceVertical = false
collectionView.showsVerticalScrollIndicator = false
collectionView.register(ATHFuncCell.self, forCellWithReuseIdentifier: cellId1);
self.addSubview(collectionView)
// MARK: - UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout
extension ATHFuncView: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let contentSize = (ScreenWidth-10*8)/4
return CGSize(width: contentSize, height: 80)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 8, left: 8, bottom: 8, right: 8)
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return 8
}
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return 8
}
func numberOfSections(in collectionView: UICollectionView) -> Int {
return 1
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 4
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: cellId1, for: indexPath) as! ATHFuncCell
switch indexPath.row {
case 0: cell.setInfo("home_func_loc", title: "Real-time location".localized())
case 1: cell.setInfo("home_func_fence", title: "Electronic fence".localized())
case 2: cell.setInfo("home_func_Leash", title: "Electronic traction".localized())
default: cell.setInfo("home_func_his", title: "History data".localized())
}
return cell
}
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
logger("ATHFuncView", sub: "didSelectItemAt", info: "Row:\(indexPath.row)")
// Will not respond here
if callBackInfo != nil {
callBackInfo!(indexPath.row)
}
}
}
I looked up the information on the Internet, and some people said that it might be a gesture conflict. How can I set it in Jelly to avoid this situation?
Thank you very much for replying.
from jelly.
😅 I found the problem and forgot when I turned it off.
collectionView.allowsSelection = false
from jelly.
Related Issues (20)
- Is there a way to set view controller custom height by his own constraints (inside the uiview controller implementation )? HOT 1
- Having a few issues upgarding HOT 8
- Interactive Transitions HOT 3
- Edge drag available after dismiss called HOT 4
- Support preferredStatusBarStyle HOT 1
- Flashing blur effect when swiping up on top of controller HOT 5
- Can I use pushViewController instead of present? HOT 1
- Push 2.2.0 to the trunk
- Request to put back Minimum deployment target to iOS 10 HOT 3
- iOS 13 support
- UIModalPresentationCustom Always present On UIWindow.rootViewController
- RetainCycle issue! HOT 11
- iOS 13 glitch issue HOT 4
- if some dismiss a view on click a button ?? HOT 1
- I encountered a problem that the system return gesture is missing HOT 3
- How to temporarily disable Canvas interaction?
- DirectionDismiss is not working
- Support App Privacy Manifest File HOT 1
- How to use CoverPresentation to automatically size the presented view controller based on content?
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 jelly.