ios - How to overlay two images in ios6 with transparency -
i trying overlay 2 images , put text on top in view have. have working in ios7. here screen shot of results
right gradient image on top of other image seen here in layout
this works great except when test on phone ios6. goes nuts seen here. *i've deleted gradient layer , ran app again , background image remains same size (about half of should be).
as can see, background image half of should be, , second image not overlaying. i've been @ 5 hours , can't seem find solution works.
here code sets background image
-(void) setdetails { if(_curinfo) { _lbltopname.text = _curinfo.company_name; if(!_curinfo.img) { showactivity(self); dispatch_queue_t aqueue1 = dispatch_get_global_queue(dispatch_queue_priority_default, 0); dispatch_async(aqueue1, ^{ _curinfo.img = getimagefromurl([nsstring stringwithformat:@"%@%@", g_serverurl, _curinfo.imgpath]); dispatch_async(dispatch_get_main_queue(), ^{ hideactivity(); [_imgcompany setimage:_curinfo.img]; }); }); } [_imgcompany setimage:_curinfo.img]; /* fix image size */ _imgcompany.contentmode=uiviewcontentmodescaleaspectfill; cgrect photoframe = _imgcompany.frame; photoframe.size = cgsizemake(320, 180); _imgcompany.frame=photoframe; [_imgcompany setclipstobounds:yes]; _lbldistance.text = [nsstring stringwithformat:@"%.2f miles", _curinfo.distance]; _lblreward.text=_curinfo.reward; cgfloat scrollviewheight = 0.0f; (uiview* view in scroller.subviews) { scrollviewheight += view.frame.size.height; } [scroller setcontentsize:(cgsizemake(320, scrollviewheight))]; } }
any appreciated. i'm not opposed drawing gradient onto image either.
additional info:
here how have 2 image views setup.
you need unstick 'opaque' option on image view, given isn't opaque.
as other spacing issue, i'd guess it's mismatch between ios 7 view controllers acting if had wantsfullscreenlayout
set yes
default having been no
under ios 6. rest of image underneath navigation bar. looks you're part trying interface builder , part doing programmatic layout — why did add code underneath fix image size
, happens if remove it?
Comments
Post a Comment