Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can Create a UIView Class and call it BannerView for instance. // in the bannerView.h</p> <pre><code> #import &lt;UIKit/UIKit.h&gt; @interface BannerView : UIView{ UIImageView* bannerImage; } @property(nonatomic,retain) UIImageView* bannerImage; @end </code></pre> <p>//in the bannerView.m</p> <pre><code>#import "BannerView.h" @implementation BannerView @synthesize bannerImage; - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { // Initialization code } return self; } // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code bannerImage=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"banner-image.png"]]; bannerImage.frame=CGRectMake(0, 0, 320, 100); [self addSubview:bannerImage]; // add a uibutton on top of the uiimageview and assign an action for it // better than creating an action recogniser UIButton* actionButton=[UIButton buttonWithType:UIButtonTypeCustom]; actionButton.frame=CGRectMake(0, 0, 320, 100); [actionButton addTarget:self action:@selector(yourAction) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:actionButton]; } -(void) yourAction{ // do what ever here like going to an other uiviewController as you mentionned } @end </code></pre> <p>Now you can call this view from any View Controller this way</p> <pre><code> BannerView* banner=[[BannerView alloc] initWithFrame:CGRectMake(0, 300, 320, 100)]; [self.view addSubview:banner]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload