How to clip larger images to fit into tabBar icons in tabBarController built programmatically.
问题 I have created a tab controller programmatically. Now, I wanted to add images to the different tabs, for which I used : self.tabBarItem.image = [UIImage imageNamed:@"Sample_Image.png"]; The problem is Sample_image is larger in size than is required by tab. So just want to know how can I clip the image to fit into tabs. 回答1: Sample_image is larger in size than is required by tab. Try this piece of code as this will resize the required image and return an UIImage instance with 30x30 size (size