ios - How to modify the color of hairline of uinavigationbar -


i've known way hairline view, uiimageview, question:how hide ios7 uinavigationbar 1px bottom line

but, modify view's background color bad experience, code this:

    [[self findhairlineimageviewunder:self.navigationcontroller.navigationbar] setbackgroundcolor:[uicolor colorwithhexstring:@"ff0000"]]; 

the findhairlineimageviewunder method answer link above

this works, not always, put in viewdidload,viewwillapear,viewdidlayoutsubviews, go original color @ scene, after push , pop.

so, i'd ask if there perfect way change color of hairline of uinavigationbar, thanks.

now found addd subview hairline's superview did trick , works fine

    uiview* sv= [[uiview alloc] initwithframe:[self findhairlineimageviewunder:self.navigationcontroller.navigationbar].frame]; sv.backgroundcolor=[uicolor colorwithhexstring:@"ff0000"]; [[self findhairlineimageviewunder:self.navigationcontroller.navigationbar].superview addsubview:sv]; 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -