2017-01-25 12 views
0

片側コーナーの進行方向ビューを設定する方法。サイドコーナーの半径でprogressviewを作成する方法

結果のprogressView添付ファイルを確認してください。 YLProgressView

以下は私のProgressViewコードです。

cell.categoryImageView.backgroundColor = [categoryColorArray objectAtIndex:indexPath.row]; 
cell.categoryImageView.image = [UIImage imageNamed:[categoryImageArray objectAtIndex:indexPath.row]]; 

cell.progressView.indicatorTextDisplayMode = MHProgressBarIndicatorTextDisplayModeProgress; 
cell.progressView.type      = MHProgressBarTypeFlat; 
cell.progressView.behavior     = MHProgressBarBehaviorIndeterminate; 
cell.progressView.stripesOrientation  = MHProgressBarStripesOrientationVertical; 

UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:cell.progressView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(10.0, 10.0)]; 

CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; 
maskLayer.frame = cell.progressView.bounds; 
maskLayer.path = maskPath.CGPath; 
cell.progressView.layer.mask = maskLayer; 

enter image description here

あなたのフィードバックは非常に歓迎です! ありがとうございます。

+0

http://stackoverflow.com/questions/10167266/how-to-set-cornerradius-for-only-top-left-and-右上隅の隅 –

+0

progressViewそのビュー –

答えて

0

あなたの進捗ビューの角の半径のためにこれを試してみてください:

UIBezierPath *progressViewPath = [UIBezierPath bezierPathWithRoundedRect:cell.progressView.bounds byRoundingCorners:(UIRectCornerTopRight | UIRectCornerBottomRight) cornerRadii:CGSizeMake(20, 0)]; 
CAShapeLayer *progressViewLayer = [[CAShapeLayer alloc] init]; 
progressViewLayer.frame = self.view.bounds; 
progressViewLayer.path = progressViewPath.CGPath; 
cell.progressView.layer.mask = progressViewLayer; 
関連する問題