菜鸟教程小白 发表于 2022-12-12 11:24:12

ios - 注册或登录 iOS7 后如何显示标签栏


                                            <p><p>基本上我有一个基于标签的应用程序,它首先需要从登录页面登录/注册,然后才能看到标签栏,我已经在这个页面上运行了大约 3 个小时,但还没有解决方案!</p>

<p>所以它更像:
LandingCtrl(tabBarNotvisible)-> LoginCtrl(tabBarNotvisible)-> profile(tabBarvisible)</p>

<p>这是我尝试过的:</p>

<p>appdelegate.m</p>

<pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [ initWithFrame:[ bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = ;

    // Initialize tab controllers.with each tab has its own navigation controller
    ProfileViewController *profileViewController =[init];
    UINavigationController *nav1 = [initWithRootViewController:profileViewController];
    ;

    DiscoverViewController *discoverViewController=[init];
    UINavigationController *nav2 = [initWithRootViewController:discoverViewController];
    ;

    RecievedViewController *recievedViewController = [init];
    UINavigationController *nav3 = [initWithRootViewController:recievedViewController];
    ;

    // initialize tabbarcontroller and set your viewcontrollers.
    self.tabBarController = [init];
    self.tabBarController.viewControllers=;

    // Inititalize Navigationcontroller and set root as tabbar.
    self.navBarController = [initWithRootViewController:self.tabBarController];

    LandingViewController *landingviewcontroller = [ init];
    UINavigationController *nVC = [ initWithRootViewController:landingviewcontroller];
    nVC = [initWithRootViewController:landingviewcontroller];
    nVC.navigationBar.barTintColor = ;
    [ setBackButtonTitlePositionAdjustment:UIOffsetMake(-100.f, 0) forBarMetrics:UIBarMetricsDefault];
    nVC.navigationBar.tintColor = ;
    nVC.navigationBar.translucent = NO;

    ;
    ;
    //;
    ;

    return YES;
}
</code></pre>

<p>仍然无法让该死的东西工作,我非常感谢您的帮助,谢谢!!!!!!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我正在关注以下代码。这对我有用,检查一次。您应该先创建登录页面,然后在登录页面上创建此逻辑。 </p>

<pre><code>NewHomeView *home=[initWithNibName:@&#34;NewHomeView_iPad&#34; bundle:nil];
      UIImage *imag=;
      initWithTitle:@&#34;Home&#34; image:imag tag:100]];

      BiographyView *biography= [ initWithNibName:@&#34;BiographyView_iPad&#34; bundle:nil];
      UIImage *imag1=;
      initWithTitle:@&#34;Biography&#34; image:imag1 tag:101]];

      GalleryView *gallery = [ initWithNibName:@&#34;GalleryView_iPad&#34; bundle:nil];
      UIImage *imag2=;
      initWithTitle:@&#34;Gallery&#34; image:imag2 tag:102]];

      VideosView *video = [ initWithNibName:@&#34;VideosView_iPad&#34; bundle:nil];
      UIImage *imag3=;
      initWithTitle:@&#34;Videos&#34; image:imag3 tag:103]];


      MoviesView *movies = [ initWithNibName:@&#34;MoviesView_iPad&#34; bundle:nil];
      UIImage *imag4=;
      initWithTitle:@&#34;Movies&#34; image:imag4 tag:104]];


      NewsView *news = [ initWithNibName:@&#34;NewsView_iPad&#34; bundle:nil];
      UIImage *imag5=;
      initWithTitle:@&#34;News&#34; image:imag5 tag:105]];

      tabController = [ init];
      ];

      ;
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 注册或登录 iOS7 后如何显示标签栏,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/25255890/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/25255890/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 注册或登录 iOS7 后如何显示标签栏