Note that there are some explanatory texts on larger screens.

plurals
  1. POUIButton with image and text doesn't work
    primarykey
    data
    text
    <p>I searched for solution I saw couple similar posts here but I couldn't fin an answer. I am trying to add an UIButton that sets with image (background colour only is good too) and i want to add text on this image </p> <p>so far this is my code :</p> <pre><code> labelSorry.text = @"לא נמצאו תוצאות.";//add text //add button. Request =[UIButton buttonWithType:UIButtonTypeCustom]; UIImage *requestimg = [UIImage imageNamed:@"requestcontact_resize2.png"]; Request.frame = CGRectMake(0.0, 120, 320.0, 30.0); Request.titleLabel.textAlignment = NSTextAlignmentRight; // Request.titleLabel.textColor = UIColorFromRGB(0xffffff); [Request setBackgroundImage:requestimg forState:UIControlStateNormal]; Request.imageView.image = [UIImage imageNamed:@"requestcontact_resize2.png"];//see no image :( this is kidding me // [Request setTitleColor:UIColorFromRGB(0xffffff) forState:UIControlStateNormal]; UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(0.0, 120, 320.0, 30.0)];///You can replace it with your own dimensions. label.textColor = UIColorFromRGB(0xffffff); label.text = @"בקש פרטי איש קשר"; [Request addSubview:label]; //[Request setBackgroundColor:UIColorFromRGB(0x704c9f)]; Request.titleLabel.text = @"בקש פרטי איש קשר"; [Request addTarget:self action:@selector(requestDetails) forControlEvents:UIControlEventTouchUpInside]; [noResultsView addSubview:Request]; [self.view addSubview:noResultsView]; </code></pre> <p>I can see the background of the button , but I can't see any text on it :( please maybe someone can enlighten me ?</p> <p>as you can see I have tried various solutions(I put them in comment) but none worked.</p> <p>P.S. I am not using xib.</p> <p>any help would be highly appreciated.</p>
    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. This table or related slice is empty.
    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