I have no title and image only Uitabbaritem. I want to know how I can change the size of the image so it can occupy the entire uitabbaritem.
I looked all over the internet, but I couldn't find anything.
I have tried:
Uistoryboard *storyboard = [Uistoryboard storyboardwithname:@ "Main_storyboard" bundle:nil];
Uitabbarcontroller *tabbarcontroller = [storyBoard instantiateviewcontrollerwithidentifier:@ "tab"];
Uitabbar *tabbar = Tabbarcontroller.tabbar;
Uitabbaritem *tabbaritem1 = [Tabbar.items objectatindex:0];
Uitabbaritem *tabbaritem2 = [Tabbar.items objectatindex:1];
Uitabbaritem *tabbaritem3 = [Tabbar.items objectatindex:2];
Tabbaritem1.imageinsets = Uiedgeinsetsmake (0,-10,-6,-10);
But nothing has changed.
A picture of the largest size of an Apple document in Tabbar is a retina monitor of x 60.
I don't think it is possible to take the whole tabbar without stretching the height of the image. I think the best solution is to use the Imageinset Tabbar image in the center
Tabbaritem1.imageinsets = Uiedgeinsetsmake (6, 0,-6, 0);
Otherwise you can play with this imageinset and stretch the image like in the screenshot
Tabbaritem1.imageinsets = Uiedgeinsetsmake (0,-10,-6,-10);
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) launchOptions {
Uitabbarcontroller *tabbarcontroller = (Uitabbarcontroller *) Self.window.rootViewController;
Uitabbar *tabbar = Tabbarcontroller.tabbar;
Uitabbaritem *tabbaritem1 = [Tabbar.items objectatindex:0];
Uitabbaritem *tabbaritem2 = [Tabbar.items objectatindex:1];
Uitabbaritem *tabbaritem3 = [Tabbar.items objectatindex:2];
Add image to Tabbaritems
Tabbaritem1.imageinsets = Uiedgeinsetsmake (0,-10,-6,-10);
}