예제 #1
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
#if DEBUG // the logger should be removed for release builds
            TIPGlobalConfiguration.SharedInstance.Logger = new Logger();
#endif
            TIPGlobalConfiguration.SharedInstance.SerializeCGContextAccess = true;
            TIPGlobalConfiguration.SharedInstance.ClearMemoryCachesOnApplicationBackgroundEnabled = true;
            TIPGlobalConfiguration.SharedInstance.AddImagePipelineObserver(new Observer());

            ImagePipeline = new TIPImagePipeline("Twitter.Example");
            ImagePipeline.AdditionalCaches = new[] { new AdditionalCache() };

            TwitterApi.SharedInstance.WorkStarted  += delegate { IncrementNetworkOperations(); };
            TwitterApi.SharedInstance.WorkFinished += delegate { DecrementNetworkOperations(); };

            // appearance
            var lightBlueColor = UIColor.FromRGB(150f / 255f, 215f / 255f, 1);
            UISearchBar.Appearance.BarTintColor = lightBlueColor;
            UISearchBar.Appearance.TintColor    = UIColor.White;
            UITextField.AppearanceWhenContainedIn(typeof(UISearchBar)).TintColor = lightBlueColor;
            UINavigationBar.Appearance.BarTintColor = lightBlueColor;
            UINavigationBar.Appearance.TintColor    = UIColor.White;
            UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes {
                TextColor = UIColor.White
            });
            UITabBar.Appearance.BarTintColor          = lightBlueColor;
            UITabBar.Appearance.TintColor             = UIColor.White;
            UISlider.Appearance.MinimumTrackTintColor = lightBlueColor;
            UISlider.Appearance.TintColor             = lightBlueColor;
            UIWindow.Appearance.TintColor             = lightBlueColor;

            // the UI
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // Image from https://icons8.com
            var firstNavController = new UINavigationController(new TwitterSearchViewController());
            firstNavController.TabBarItem = new UITabBarItem("Search", UIImage.FromBundle("Search"), 1);
            var secondNavController = new UINavigationController(new SettingsViewController());
            secondNavController.TabBarItem = new UITabBarItem("Settings", UIImage.FromBundle("Settings"), 2);
            var thirdNavController = new UINavigationController(new InspectorViewController());
            thirdNavController.TabBarItem = new UITabBarItem("Inspector", UIImage.FromBundle("Inspector"), 3);

            tabBarController = new UITabBarController();
            tabBarController.ViewControllers = new[] {
                firstNavController,
                secondNavController,
                thirdNavController
            };

            Window.RootViewController = tabBarController;
            Window.BackgroundColor    = UIColor.Orange;
            Window.MakeKeyAndVisible();

            return(true);
        }
 public PipelineCacheInspectionResultsViewController(ITIPImagePipelineInspectionResultEntry[] entries, TIPImagePipeline imagePipeline)
     : base(UITableViewStyle.Grouped)
 {
     results  = entries.ToList();
     pipeline = imagePipeline;
 }