Skip to content

Commit

Permalink
fix: better suited ios indicator size
Browse files Browse the repository at this point in the history
  • Loading branch information
benedictstrube committed Jan 4, 2022
1 parent beef4e6 commit 81941e6
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/ui-pager/index.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ export class Pager extends PagerBase {
super.initNativeView();
const nativeView = this.pager;
nativeView.registerClassForCellWithReuseIdentifier(PagerCell.class(), this._defaultTemplate.key);
nativeView.backgroundColor = UIColor.clearColor;
nativeView.autoresizesSubviews = false;
nativeView.autoresizingMask = 0;
nativeView.dataSource = this.mDataSource = UICollectionViewDataSourceImpl.initWithOwner(new WeakRef(this));
nativeView.scrollEnabled = !this.disableSwipe;
if (this.orientation === 'vertical') {
Expand Down Expand Up @@ -263,6 +266,22 @@ export class Pager extends PagerBase {
}
this.mIndicatorView.tintColor = UIColor.whiteColor;
this.mIndicatorView.currentPageTintColor = UIColor.whiteColor;

switch (value) {
case Indicator.None:
case Indicator.Worm:
case Indicator.Fill:
case Indicator.Swap:
case Indicator.THIN_WORM:
case Indicator.Disabled:
this.mIndicatorView.radius = 4;
break;

case Indicator.Flat:
this.mIndicatorView.radius = 2;
this.mIndicatorView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.7, 0.5);
break;
}
}

//@ts-ignore
Expand Down

0 comments on commit 81941e6

Please sign in to comment.