UI调整
This commit is contained in:
@@ -301,9 +301,9 @@
|
|||||||
[self.view addSubview:_boxInputView];
|
[self.view addSubview:_boxInputView];
|
||||||
[_boxInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[_boxInputView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||||
make.width.mas_equalTo(XX_6(262));
|
make.left.mas_equalTo(offXStart);
|
||||||
|
make.right.mas_equalTo(-offXStart);
|
||||||
make.height.mas_equalTo(YY_6(52));
|
make.height.mas_equalTo(YY_6(52));
|
||||||
make.centerX.offset(0);
|
|
||||||
make.top.equalTo(strongSelf.bigLockImageView.mas_bottom).offset(YY_6(18));
|
make.top.equalTo(strongSelf.bigLockImageView.mas_bottom).offset(YY_6(18));
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -317,6 +317,7 @@
|
|||||||
- (CRBoxInputView *)generateBoxInputView_normal
|
- (CRBoxInputView *)generateBoxInputView_normal
|
||||||
{
|
{
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 20, 0, 20);
|
||||||
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
||||||
|
|
||||||
if (@available(iOS 12.0, *)) {
|
if (@available(iOS 12.0, *)) {
|
||||||
@@ -335,6 +336,7 @@
|
|||||||
cellProperty.cellPlaceholderFont = [UIFont systemFontOfSize:20];
|
cellProperty.cellPlaceholderFont = [UIFont systemFontOfSize:20];
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 20, 0, 20);
|
||||||
_boxInputView.ifNeedCursor = NO;
|
_boxInputView.ifNeedCursor = NO;
|
||||||
_boxInputView.placeholderText = @"露可娜娜";
|
_boxInputView.placeholderText = @"露可娜娜";
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
@@ -364,6 +366,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
||||||
@@ -409,6 +412,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
[_boxInputView loadAndPrepareViewWithBeginEdit:YES];
|
||||||
@@ -431,6 +435,7 @@
|
|||||||
cellProperty.securitySymbol = @"*";//need
|
cellProperty.securitySymbol = @"*";//need
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||||
_boxInputView.ifNeedSecurity = YES;//need
|
_boxInputView.ifNeedSecurity = YES;//need
|
||||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
@@ -474,6 +479,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||||
_boxInputView.ifNeedSecurity = YES;//need
|
_boxInputView.ifNeedSecurity = YES;//need
|
||||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
@@ -515,6 +521,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
CRBoxInputView *_boxInputView = [[CRBoxInputView alloc] initWithCodeLength:4];
|
||||||
|
_boxInputView.mainCollectionView.contentInset = UIEdgeInsetsMake(0, 10, 0, 10);
|
||||||
_boxInputView.ifNeedSecurity = YES;//need
|
_boxInputView.ifNeedSecurity = YES;//need
|
||||||
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
_boxInputView.boxFlowLayout.itemSize = CGSizeMake(XX_6(52), XX_6(52));
|
||||||
_boxInputView.customCellProperty = cellProperty;
|
_boxInputView.customCellProperty = cellProperty;
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@property (assign, nonatomic) NSInteger itemNum;
|
@property (assign, nonatomic) NSInteger itemNum;
|
||||||
|
|
||||||
|
/** minLineSpacing
|
||||||
|
* default: 10
|
||||||
|
*/
|
||||||
@property (assign, nonatomic) NSInteger minLineSpacing;
|
@property (assign, nonatomic) NSInteger minLineSpacing;
|
||||||
|
|
||||||
- (void)autoCalucateLineSpacing;
|
- (void)autoCalucateLineSpacing;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
{
|
{
|
||||||
self.ifNeedEqualGap = YES;
|
self.ifNeedEqualGap = YES;
|
||||||
self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
self.scrollDirection = UICollectionViewScrollDirectionHorizontal;
|
||||||
self.minLineSpacing = 5;
|
self.minLineSpacing = 10;
|
||||||
self.minimumLineSpacing = 0;
|
self.minimumLineSpacing = 0;
|
||||||
self.minimumInteritemSpacing = 0;
|
self.minimumInteritemSpacing = 0;
|
||||||
self.sectionInset = UIEdgeInsetsZero;
|
self.sectionInset = UIEdgeInsetsZero;
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
{
|
{
|
||||||
if (self.itemNum > 1) {
|
if (self.itemNum > 1) {
|
||||||
CGFloat width = CGRectGetWidth(self.collectionView.frame);
|
CGFloat width = CGRectGetWidth(self.collectionView.frame);
|
||||||
self.minimumLineSpacing = floor(1.0 * (width - self.itemNum * self.itemSize.width) / (self.itemNum - 1));
|
self.minimumLineSpacing = floor(1.0 * (width - self.itemNum * self.itemSize.width - self.collectionView.contentInset.left - self.collectionView.contentInset.right) / (self.itemNum - 1));
|
||||||
|
|
||||||
if (self.minimumLineSpacing < self.minLineSpacing) {
|
if (self.minimumLineSpacing < self.minLineSpacing) {
|
||||||
self.minimumLineSpacing = self.minLineSpacing;
|
self.minimumLineSpacing = self.minLineSpacing;
|
||||||
|
|||||||
@@ -518,8 +518,8 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) {
|
|||||||
_mainCollectionView.backgroundColor = [UIColor clearColor];
|
_mainCollectionView.backgroundColor = [UIColor clearColor];
|
||||||
_mainCollectionView.delegate = self;
|
_mainCollectionView.delegate = self;
|
||||||
_mainCollectionView.dataSource = self;
|
_mainCollectionView.dataSource = self;
|
||||||
_mainCollectionView.layer.masksToBounds = NO;
|
_mainCollectionView.layer.masksToBounds = YES;
|
||||||
_mainCollectionView.clipsToBounds = NO;
|
_mainCollectionView.clipsToBounds = YES;
|
||||||
[_mainCollectionView registerClass:[CRBoxInputCell class] forCellWithReuseIdentifier:CRBoxInputCellID];
|
[_mainCollectionView registerClass:[CRBoxInputCell class] forCellWithReuseIdentifier:CRBoxInputCellID];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user