使用ack搜索没有扩展名的文件(Using ack to search inside files with no extensions)
我有一些文本“bar”包含在文件
FOO
和foo.cc
。有没有办法告诉
ack-grep
搜索没有扩展名的文件(即FOO
)?我尝试过这样的事情:
ack-grep --type-set=foo=FOO bar
它返回foo.cc中的文本,但不返回文件FOO。
我还将--type-set添加到我的.ackrc文件中,调用
ack-grep --help-types
表明ack-grep正在寻找
.FOO
文件。I have some text "bar" contained in files
FOO
andfoo.cc
.Is there a way to tell
ack-grep
to search inside files with no extension (namelyFOO
)?I've tried something like this:
ack-grep --type-set=foo=FOO bar
which returns the text in foo.cc, but not file FOO.
I've also added the --type-set to my .ackrc file, calling
ack-grep --help-types
shows that ack-grep is looking for
.FOO
files.
原文:https://stackoverflow.com/questions/17751437
最满意答案
您应该在视图的
layoutSubviews
方法内或视图控制器的viewDidLayoutSubviews
方法内更新mask
层的frame
。因为在设置遮罩层的
frame
,视图具有不同的框架。autolayout
布局更新帧和布局子视图后,视图具有正确的frame
值。 并且autolayout
可能在UIView
级别运行,而不是在CALayer
级别运行。 因此,您应该在布局阶段后更新遮罩层的框架。You should update the
frame
ofmask
layer insidelayoutSubviews
method of your views or insideviewDidLayoutSubviews
method of your view controller.Because when you set mask layer's
frame
, the view has a different frame. Afterautolayout
updates the frames and layouts subviews, the view has the correctframe
value. And probablyautolayout
operates atUIView
level, not onCALayer
level. Therefore you should update mask layer's frame after layout phase.
相关问答
更多-
升级到Xcode 8后,UIButton的转角半径不起作用(Corner radius for UIButton not working after upgrading to Xcode 8)[2023-08-10]
很可能你很快就会运行该代码(例如viewDidLoad )。 在viewDidLayoutSubviews 。 In all probability you are running that code too soon (e.g. viewDidLoad). Do it in, say, viewDidLayoutSubviews. -
查看角点半径问题(View Corner Radius Issue)[2022-03-26]
尝试使用它,它会在我的项目中正常工作 self.view1.layer.cornerRadius=_slider1.value;//Value as per your requirement CALayer *borderLayer = [CALayer layer]; CGRect borderFrame = CGRectInset(CGRectZero,-1,-1); [borderLayer setBackgroundColor:[[UIColor clearColor] CGColor]]; [b ... -
想象一下,在构成视图的矩形的每个角上都有一个圆圈。 角的圆角遵循圆弧。 cornerRadius是该圆的半径。 Imagine a circle at each corner of the rectangle framing the view. The rounded edge of the corner follows the arc of the circle. cornerRadius is the radius of that circle.
-
您需要将图层的masksToBounds属性设置为YES : cell.previewImage.layer.masksToBounds = YES; 这是因为UIImageView控件创建一个伪子视图来保存UIImage对象。 You need to set the layer's masksToBounds property to YES: cell.previewImage.layer.masksToBounds = YES; This is because the UIImageView contr ...
-
这个网站做得非常好解释: http : //www.paintcodeapp.com/blogpost/code-for-ios-7-rounded-rectangles (简而言之,它只是iOS7的一部分) 有关其他说明,请参阅: http : //www.mani.de/backstage/?p = 483 This website does a pretty good job explaining: http://www.paintcodeapp.com/blogpost/code-for-ios-7 ...
-
子类化时的UIImageView根本不调用绘制方法。 这是不允许的,尽管最低限度的记录。 在这种情况下,建议对UIView进行子类化,然后自己在draw方法的视图上绘制图像。 了解更多信息: drawRect不会在我的UIImageView的子类中被调用 UIImageView when subclassed does not call the draw method at all. It is not allowed, although minimally documented. In this case ...
-
将此行放在控制器中所有...layer.cornerRadius =行之前: self.view.layoutIfNeeded() Put this line right before all of your ...layer.cornerRadius = lines in your controllers: self.view.layoutIfNeeded()
-
您应该在视图的layoutSubviews方法内或视图控制器的viewDidLayoutSubviews方法内更新mask层的frame 。 因为在设置遮罩层的frame ,视图具有不同的框架。 autolayout布局更新帧和布局子视图后,视图具有正确的frame值。 并且autolayout可能在UIView级别运行,而不是在CALayer级别运行。 因此,您应该在布局阶段后更新遮罩层的框架。 You should update the frame of mask layer inside layout ...
-
要在这样的按钮上生成圆角,如果将cornerRadius值设置为30 ,则假定按钮的高度设置为60 。 这可能并非所有设备都是如此,具体取决于您如何处理布局。 看到你的图像,它看起来像按钮比你设计的稍低。 两种选择: 使用自动布局并在您的按钮上添加一个“固定高度”约束,其值为60 ,因此您的按钮总是具有60点的高度。 实现一个UIButton子类,并在layoutSubviews方法中,将cornerRadius设置为按钮bounds高度的一半。 这样,只要系统重新绘制按钮,角半径就会适当更新。 To ge ...
-
使用背景颜色在UIDatePicker上设置圆角半径(Setting corner radius on UIDatePicker with a background color)[2022-03-30]
你必须添加layer.masksToBounds=YES; 尝试这个, self.datePicker.backgroundColor = [UIColor lightTextColor]; self.datePicker.layer.cornerRadius = 10; self.datePicker.layer.masksToBounds=YES; You have to add layer.masksToBounds=YES; Try this, self.datePicker.background ...