Custom Swift Tab Bar

Hi, I was looking for everything, and I still can not find any information that would help me with this task. How to create a custom tab bar that looks like this: Swift:

Here is a link to an image of what the tab bar looks like: http://2.bp.blogspot.com/-QlGT8CjZqJw/VbUZDwlRXzI/AAAAAAAAAEHg/zqT_1Valsvo/s1600/Tab%2Bbar.png

The tab bar will look like this, and the selected tab will look like the middle icon, I have all the assets for this, but how would I set up the tab to look like this?

+4
source share
4 answers

-, @2x @3x (@1x, iOS 7). #2E967E :

  • icon @2x = 50x50
  • icon @3x = 75x75

images.xcassets . 3 . ( ) " "

, , "", . , , . ( = ), .

, ( " " → " " → "" ) 47E9C3. .

!

+2

applicationDidFinishLaunchingWithOption. "tabbarbg.png" = 49.

 UITabBar.appearance().tintColor = UIColor.lightGrayColor()//selected tab color
 UITabBar.appearance().backgroundImage = UIImage(named:"tabbarbg.png")
 UITabBar.appearance().barTintColor = UIColor.whiteColor()
+1

, Images.xcassets, main.storyboard

0

, , . , [.. , , , , , ] . enter image description here

, ,

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UITabBar appearance] setTintColor:[UIColor blackColor]];
[[UITabBar appearance] setSelectionIndicatorImage:[UIImage imageNamed:@"image1"]];}

C

0

Source: https://habr.com/ru/post/1599752/


All Articles