0
UIImageView의 하위 클래스에 사용자 지정 속성을 추가하려고합니다. 속성 유형은 UIImageView입니다. 다른 데이터 유형, UIColor, int 등에서 성공했습니다. 그러나 UIImageView는 인터페이스 빌더의 사용자 정의 필드에 나타나지 않으며 코드를 통해 액세스 할 수 없습니다.IB_DESIGNABLE 및 IBINSTECTABLE UIImageView
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface newLayerController : UIImageView
@property (nonatomic, copy) IBInspectable UIImageView *imageSheet;
- (void)drawShape:(CGPoint)point;
- (void)endTouch:(CGPoint)point;
- (void)startTouch:(CGPoint)point;
@end
누구나 빠른 수정을 아십니까?
ibinspectable uiimageview를 사용할 수 없습니다. 그러나 당신은 @property (nonatomic, copy) IBInspectable UIImage * 이미지를 가질 수 있습니다; 코드에서보기에 지정할 수 있습니다. –