خرید بک لینک

Vote count: 0

I'm begier in Objective-C. When i use addSubview in method setupView to see image, this doesn't work. Please, help.

    h.


    @interface CollectionViewController : UICollectionViewController 

    @end

    @interface MyCell : UICollectionViewCell 

    @end

and

    m.


    @interface MyCell ()

    @end

    @implementation MyCell

    - (instancetype)initWithFrame:(CGRect)frame {
            self = [super initWithFrame:frame];
        if (self) [self setupView];
            retu self;

        }

    - (id)initWithCoder:(NSCoder *)aDecoder
    {
        self = [super initWithCoder:aDecoder];
        if (self) [self setupView];
        retu self;
    }

    -(UIImageView *)myImageView {

        UIImageView *imageView = [UIImageView new];
        imageView.image = [UIImage imageNamed:@"photo.jpg"];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.layer.masksToBounds = true;
        retu imageView;

    }

    -(void)setupView {

        self.backgroundColor = [UIColor whiteColor];

        [self addSubview:self.myImageView];

    }

    @end

enter image description here

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: جمعه 24 ارديبهشت 1395 ساعت: 0:23

صفحه بندی