-1

I am trying to remove top line in TabBar in iOS 13.2.2 but none of these answer in below post work anymore for iOS 13.2.2

Link - Remove top line from TabBar

  1. Is there any API changes recently?

  2. How to remove and reset top line in TabBar in iOS 13.2.2 ?

DevesH
  • 486
  • 4
  • 18

1 Answers1

-2

It's always better if you write your own TabBar class to make sure you can do all the changes you want.

#import "ViewController.h"

@protocol TabBarDelegate;

@interface TabBar : UIView{
    id<TabBarDelegate> delegate;
    UIView *backgroundView;
    UIButton *btn1;
    UIButton *btn2;

    UIImageView *img1;
    UIImageView *img2;

    UIView *hubHolder;

}

@property (nonatomic, retain) UIView *backgroundView;
@property (nonatomic, retain) id<TabBarDelegate> delegate;
@property (nonatomic, retain) UIButton *btn1;
@property (nonatomic, retain) UIButton *btn2;

@property (nonatomic, retain) UIImageView *img1;
@property (nonatomic, retain) UIImageView *img2;

- (id) initWithFrame:(CGRect)frame;

@end

@protocol TabBarDelegate<NSObject>

@optional
- (void) tabbarTapped:(int)index;

@end

You can easily define a view with buttons (button number depends on how many controllers you want to go by tab bar) and delegate to control if one of the buttons tapped. Since this is a UIView you can manipulate how it looks. I hope it helps.

OykuNehir
  • 51
  • 6
  • For what the question asked, the statement "It's always better if you write your own TabBar class to make sure you can do all the changes you want." is not true. In this case it's easy to remove the line without subclassing. – Patrick Mar 21 '22 at 07:28