0

我想通过将SBBulletinBlurredShadowLabel(私有框架)与 theos 挂钩来隐藏它的模糊阴影。

SBBulletinBlurredShadowLabel.h:

#import "UILabel.h"

@interface SBBulletinBlurredShadowLabel : UILabel
{
}

- (struct CGSize)sizeThatFits:(struct CGSize)arg1;
- (void)drawTextInRect:(struct CGRect)arg1;

@end

在这里使用它

SBBulletinHeaderView.h:

#import "SBBulletinLinenSegmentView.h"

@class NSString, SBBulletinBlurredShadowLabel, SBBulletinClearButton, UIView;

@interface SBBulletinHeaderView : SBBulletinLinenSegmentView
{
    UIView *_translucentOverlay;
    UIView *_iconView;
    SBBulletinBlurredShadowLabel *_sectionLabel;
    SBBulletinClearButton *_clearButton;
    id <SBBulletinHeaderViewDelegate> _delegate;
    NSString *_sectionID;
}

+ (float)headerHeight;
- (id)initWithFrame:(struct CGRect)arg1 linenView:(id)arg2;
@property(retain, nonatomic) NSString *sectionID; // @synthesize sectionID=_sectionID;
- (void)dealloc;
- (void)setShowsClearButton:(BOOL)arg1 animated:(BOOL)arg2;
- (void)layoutSubviews;
- (void)willMoveToWindow:(id)arg1;
- (id)_sectionNameForSectionID:(id)arg1;
- (id)_newIconViewForSectionID:(id)arg1;
@property(readonly, nonatomic) SBBulletinClearButton *clearButton; // @synthesize clearButton=_clearButton;
@property(nonatomic) id <SBBulletinHeaderViewDelegate> delegate; // @synthesize delegate=_delegate;

@end

什么不起作用:

%hook SBBulletinBlurredShadowLabel 
- (void)drawTextInRect:(struct CGRect)arg1 {
//skips it. The label disappears
}
%end

%hook SBBulletinHeaderView
- (void)layoutSubviews {
// does not work since SBBulletinBlurredShadowLabel doesn't use the standard UILabel shadow
self._sectionLabel.shadowColor = [UIColor clearColor];
}
%end

我的想法:

%hook SBBulletinBlurredShadowLabel
- (void)drawTextInRect:(struct CGRect)arg1 {
[super drawTextInRect:arg1];
}
%end

但是我不知道使用theos挂钩时如何调用super。

任何建议如何隐藏阴影或如何调用超级?

4

1 回答 1

0

在 Theos%orig;中,等价于带有原始参数的 super;

您还%orig(arg1, arg2, etc);可以将自定义参数传递给 super。

于 2012-07-01T17:45:16.937 回答