简体   繁体   English

为选项卡栏放置背景图像

[英]Placing of background image for Tab bar

I have placed background image on tab bar but the problem is that the second item should have a raised curve of the background. 我已经在标签栏上放置了背景图片,但是问题是第二个项目的背景应该有凸起的曲线。 It is looking good in 6s and 6s Plus but not in 5s and 4s. 在6s和6s Plus中看起来不错,但在5s和4s中则不然。 [The background image looks proper in 6s][1] The background image does not look proper in 5s . [背景图像在6s内看起来合适] [1] 背景图像在5s内看起来不合适 How to set background image according to my need in 5s. 如何在5秒钟内根据我的需要设置背景图像。 I have used the following image. 我使用了以下图片。 Background Image 背景图

Just for iPhone5s and 4s as you say in your side iPhone 6 and 6 Plus looking good. 正如您所说的那样,仅适用于iPhone5s和4s,iPhone 6和6 Plus看起来不错。

在此处输入图片说明

This is tabbarBg.png . 这是tabbarBg.png。 size 320 * 59. Resized your image for iPhone 4s and 5s. 尺寸320 *59。为iPhone 4s和5s调整图像尺寸。

Place the following code in your AppDelagate 将以下代码放入您的AppDelagate中

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.

    if ([[UIScreen mainScreen] bounds].size.width == 320) {

        [[UITabBar appearanceWhenContainedIn:[UIViewController class], nil] setBackgroundImage:[UIImage imageNamed:@"tabbarBg.png"]];
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM