如何删除和重置TabBar中的顶行-适用于iOS 13+;

如何删除和重置TabBar中的顶行-适用于iOS 13+;,ios,objective-c,swift,uitabbar,Ios,Objective C,Swift,Uitabbar,我正在尝试删除iOS 13.2.2中TabBar中的顶行,但在iOS 13.2.2的下面的后期工作中,这些都没有答案 链接- 最近API有什么变化吗 如何在iOS 13.2.2中删除和重置TabBar中的顶行 如果您编写自己的TabBar类来确保您可以完成所有您想要的更改,那就更好了 #import "ViewController.h" @protocol TabBarDelegate; @interface TabBar : UIView{ id<TabBarDelegate

我正在尝试删除iOS 13.2.2中TabBar中的顶行,但在iOS 13.2.2的下面的后期工作中,这些都没有答案

链接-

  • 最近API有什么变化吗

  • 如何在iOS 13.2.2中删除和重置TabBar中的顶行


  • 如果您编写自己的TabBar类来确保您可以完成所有您想要的更改,那就更好了

    #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
    
    #导入“ViewController.h”
    @协议TabBarDelegate;
    @界面选项卡栏:UIView{
    id代表;
    UIView*背景视图;
    UIButton*btn1;
    UIButton*btn2;
    UIImageView*img1;
    UIImageView*img2;
    UIView*轮毂支架;
    }
    @属性(非原子,保留)UIView*背景视图;
    @属性(非原子,保留)id委托;
    @属性(非原子,保留)UIButton*btn1;
    @属性(非原子,保留)UIButton*btn2;
    @属性(非原子,保留)UIImageView*img1;
    @属性(非原子,保留)UIImageView*img2;
    -(id)initWithFrame:(CGRect)帧;
    @结束
    @协议TabBarDelegate
    @可选的
    -(void)tabbarTapped:(int)索引;
    @结束
    
    您可以使用按钮(按钮编号取决于您希望通过选项卡栏访问的控制器数量)轻松定义视图,并在点击其中一个按钮时委托控制。由于这是一个UIView,您可以操纵它的外观。
    我希望有帮助

    你尝试过这个解决方案吗@是的,我尝试过类似的解决方案。