Posts

Post not yet marked as solved
0 Replies
1.3k Views
Hi All,I'm working to move all of my CollectionView grids over to Compositional Layouts. It's been smooth sailing until I have to create a cell in a certain aspect ratio (1.0 width, 1.33 height) - so it's essentially a rectangle, but the height is a ratio (1.33) of the cells width - no matter how many columns I use.I've got 4 columns across in the example code below - and was able to get it to paint alright - but it's not based on any aspect ratio of the cell - but rather the aspect at the whole container width. So if I change the count to 5 columns, the cells will be way too high.Any ideas? I'm sure it's something simple, but I'm just overthinking this.Thanks!func createLayout() -> UICollectionViewLayout { let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalWidth(0.3)) let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitem: item, count: 4) let spacing = CGFloat(25) group.interItemSpacing = .fixed(spacing) let section = NSCollectionLayoutSection(group: group) section.interGroupSpacing = spacing section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 25, bottom: 0, trailing: 25) let headerFooterSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(100)) let sectionHeader = NSCollectionLayoutBoundarySupplementaryItem( layoutSize: headerFooterSize, elementKind: UICollectionView.elementKindSectionHeader, alignment: .top) section.boundarySupplementaryItems = [sectionHeader] let layout = UICollectionViewCompositionalLayout(section: section) return layout }
Posted
by sigursalt.
Last updated
.
Post not yet marked as solved
2 Replies
2.3k Views
Hi,I have a wkwebview that I've added some font scaling accessibility controls to. In iOS13b2 it appears to not be working any longer. I'm hoping this is just a bug and not something they aren't supporting anymore. I've not been able to use any Feedback Assistants to file a bug (it says feedback is closed).Here's what I'm doing that is no longer changing the font size:func webViewEvaluateJS() { let js = "document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust='\(fontSize)%'" webView.evaluateJavaScript(js, completionHandler: nil) }fontSize is a var I declare that gets updated on a UISlider - I have a didSet that fires the webViewEvaluateJS().Anyone else using/experiencing something similiar ?Thanks.
Posted
by sigursalt.
Last updated
.