在这里,我尝试制作圆角矩形角进度条但是我有一些问题要创建它,在这里我发布了我的代码我尝试了什么?
任何一个人都想让自定义进度条到圆角矩形进度条。
self.progressView.frame=CGRectMake(55, 490, 200, 15)
self.progressView.layer.cornerRadius = 15.0
self.progressView.transform=CGAffineTransformMakeScale(1.0, 7.0)
答案 0 :(得分:24)
虽然您已设置了角半径,但您还需要通过设置
告诉视图不要在视图边界之外绘制任何内容。self.progressView.clipsToBounds = true
答案 1 :(得分:8)
如果你想为内栏设置圆边,你也可以添加以下代码:
@echo off
for /F "skip=10 delims=" %%I in ('dir "d:\backup\*" /AD /B /O-N 2^>nul') do rd /Q /S "d:\backup\%%I"
答案 2 :(得分:2)
它告诉您设置拐角半径,然后裁剪到边界:(子层是这样,因此内部栏也具有圆角。) 如此添加这些行 因为您需要同时设置进度颜色和他的图层...
progressBar.layer.cornerRadius = 8
progressBar.clipsToBounds = true
progressBar.layer.sublayers![1].cornerRadius = 8
progressBar.subviews[1].clipsToBounds = true
答案 3 :(得分:1)
Swift 5.0
//Extension to set corner any view set border width and color.
extension UIView{
func setCorner(withRadius:Int, borderWidth:Int = 0, color: UIColor = .clear){
self.layer.cornerRadius = radius
self.layer.borderColor = color
self.layer.borderWidth = borderWidth
self.clipsToBounds = true
}
}
用作
self.progressView.setCorner(withRadius: 12)
答案 4 :(得分:0)
UIProgressView更改了UIImageView的位置,该位置显示进度条的当前值。我有小小的更新来解决此问题
for col in cols:
for i in list(ind):#looping thru each cell of the DataFrame
req = Request(Cleaned_up_df[col][1], headers={'USER-AGENT': 'Mozilla/5.0'})
article=urlopen(req).read()
parsed_article=bs.BeautifulSoup(article,'lxml')#parsing
paragraphs=parsed_article.find_all('p')#pulling contents with tag <p>
article_text=''
for p in paragraphs:
article_text = article_text + ". " +p.text
#aggregating contents of all <p> tags in this page
article_text=re.sub(r'\[[0-9]*\]', ' ',article_text)
article_text=re.sub('^[0-9]{1,2}[.]$', ' ',article_text)
article_text=re.sub(r'\s+', ' ',article_text)
formatted_article_text=re.sub('[^a-zA-Z]',' ',article_text)
formatted_article_text=re.sub(r'\s+',' ',formatted_article_text)