标签: uitabbar

是否可以更改UITabBarItem徽章颜色

我想更改UITabBarItem 徽章的背景颜色,但找不到任何有关如何制作它的资源.

在此输入图像描述

iphone objective-c uitabbaritem uitabbar ios

29
推荐指数
8
解决办法
3万
查看次数

如何在标签栏中设置徽章值?

我必须从xml读取数据,并且必须在视图控制器中显示值.我正在使用tab barcontroller.我必须阅读xml数据,并在标签栏中显示为徽章.这是我的控制器代码.

-(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict
{

    if([elementName isEqualToString:@"Event"]) {
        //Initialize the array.
        rssOutputData  = [[NSMutableArray alloc] init];
        mycount = [attributeDict objectForKey:@"count"];
         NSLog(@"Reading count value :%@",mycount);
    }
    else if([elementName isEqualToString:@"eventdashboard"]) {
        //Initialize the book.
        aEvent = [[Eventlist alloc] init];
        //Extract the attribute here.
        aEvent.id = [[attributeDict objectForKey:@"userid"] integerValue];
        NSLog(@"Reading id value :%d", aEvent.id);
    }
    NSLog(@"Processing Element: %@", elementName);
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
    if(!nodecontent)
        nodecontent = [[NSMutableString alloc] initWithString:string];else
            [nodecontent appendString:string]; …
Run Code Online (Sandbox Code Playgroud)

xml objective-c uitabbar ios

29
推荐指数
3
解决办法
4万
查看次数

automaticAdjustsScrollViewInsets不起作用

我已经创建了一个非常简单的演示应用来测试其功能automaticallyAdjustsScrollViewInsets,但是我的标签栏覆盖了tableView的最后一个单元格.

我的AppDelegate代码:

UITabBarController *tabControl = [[UITabBarController alloc] init];
tabControl.tabBar.translucent = YES;
testViewController *test = [[testViewController alloc] init];
[tabControl setViewControllers:@[test]];

[self.window setRootViewController:tabControl];
Run Code Online (Sandbox Code Playgroud)

我的testViewController(UITableViewController的子类)代码:

- (void)viewDidLoad
{
[super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = YES;
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds];
self.tableView.dataSource = self;
self.tableView.scrollIndicatorInsets = self.tableView.contentInset;
//[self.view addSubview:self.tableView];

// Do any additional setup after loading the view.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 20;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@""];
cell.textLabel.text = @"test"; …
Run Code Online (Sandbox Code Playgroud)

objective-c uiscrollview uitabbar ios ios7

29
推荐指数
3
解决办法
3万
查看次数

真的很酷的方式来为iPhone应用程序创建自定义UITabBar?

我最近正在做很多研究,如何UITabBar在我的iPhone应用程序上获得不同的效果,但不幸的是我只是在寻找如何替换背景颜色等等.

好吧,我已经看过这款名为Momento的应用程序非常酷,并提供了一个非常漂亮的tabBar:

Momento的UITabBar

所以这里有几个元素我想问你们,如果你能帮助我,给我正确的指示如何获得类似的效果:)

  • 项目上方的箭头:正如您所看到的,此应用程序具有此动画箭头,该箭头在所选项目上方以非常平滑的动画运行.

  • 选定规定的项目的形象是不是蓝光ISH默认一个均未显示以不同深浅的棕色和灰色版本的默认状态.

  • 漂亮的项目分隔符与斜面垂直线条.

  • tabBar的不同背景图像

  • tabBar的高度不同

在经过一些研究之后,我可以通过子类化来设置高度和背景图像,UITabBarController但我仍然不确定如何完成其​​他项目,特别是第一个与漂亮箭头效果相关的项目.

如果有人知道如何执行此操作的非常好的教程,那么通过子类化来明确可以做什么或不可以做什么将是很好的UITabBarController,特别是如果可以在Interface Builder中完成:)

我刚开始在这个关于iOS的应用程序开发世界,所以如果你能帮助我,那将非常感激

非常感谢提前

iphone customization uitabbaritem uitabbar ios

27
推荐指数
3
解决办法
4万
查看次数

如何在iOS 5中更改UITabBarItem中的文本颜色

在iOS 5中具有更多外观控制,我们如何更改UITabBarItem文本颜色?从默认白色到其他颜色?

编辑:工作解决方案

  [[UITabBarItem appearance] setTitleTextAttributes:
         [NSDictionary dictionaryWithObjectsAndKeys:
          [UIColor blackColor], UITextAttributeTextColor, 
          [UIColor whiteColor], UITextAttributeTextShadowColor, 
          [NSValue valueWithUIOffset:UIOffsetMake(0, 1)], UITextAttributeTextShadowOffset, 
          [UIFont fontWithName:@"Rok" size:0.0], UITextAttributeFont, 
          nil] 
                                              forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)

iphone xcode uitabbarcontroller uitabbar ios

27
推荐指数
3
解决办法
3万
查看次数

如何在iOS 7中更改tabBarItems的文本和图标颜色?

如何在iOS 7中更改UITabBar和UITabBarItems的文本和图标颜色?对于未选中的tabbar项,默认的灰色文本看起来很暗,难以阅读.

tabbar uitabbarcontroller uitabbaritem uitabbar ios7

27
推荐指数
5
解决办法
7万
查看次数

hidesBottomBarWhenPushed = NO不工作?

我有一个UITabBar在我的应用程序中,我UIViewController通过将此行放在A ppDelegate中而隐藏在第一个选项卡中的第一个:

// ... in MyAppDelegate.m
firstViewController.hidesBottomBarWhenPushed = YES;
Run Code Online (Sandbox Code Playgroud)

firstViewController,用户可以推送一个在同一个选项卡UIButton中推送新内容UIViewController.UITabBar当发生这种情况时,我希望能再次看到它.我试图让它像这样回来:

//... in firstViewController.m

secondViewController = [[SecondViewController alloc] init];
secondViewController.hidesBottomBarWhenPushed = NO;
[[self navigationController] pushViewController:secondViewController animated:YES];
Run Code Online (Sandbox Code Playgroud)

不幸的是,没有带回来UITabBar.它仍然是隐藏的.

UITabBar隐藏后如何正确地带吧?

提前致谢.

iphone objective-c uitabbarcontroller uitabbar

26
推荐指数
3
解决办法
2万
查看次数

显示在标签栏后面的TableView

我正在更新我的应用程序以使用iOS 7,我遇到了表视图的问题.我的标签栏是半透明的.问题是当我滚动到表格视图的底部时,最后一个单元格的一部分仍然位于标签栏的后面.我想在最后一个单元格和标签栏之间留出一点空间.我可以通过使用不透明的标签栏来解决这个问题,但我想让它保持半透明.

在此输入图像描述

objective-c uitableview uitabbar ios ios7

26
推荐指数
5
解决办法
3万
查看次数

如何更改标签栏图标的高亮颜色?(iPhone/ipad公司)

我几天来一直在网上寻找这个问题的答案但没有成功.基本上我想要做的是改变我的图标的高亮颜色UITabBar.默认情况下,它们在选中时会以蓝色突出显示,但是我已经看到了几个已经设法更改此功能的应用程序(例如,麦当劳应用程序,如下所示).

在此输入图像描述

我想要做的是将高亮颜色设置为红色,如果可能的话请有人帮助我吗?

注意:如果它让事情变得更容易我将目标用于iOS5+的用户.

iphone uitabbar ipad ios5

25
推荐指数
2
解决办法
2万
查看次数

更改Swift中的标签栏字体

我一直在尝试更改标签栏项目的字体,但是我找不到任何Swift示例.我知道这就是你在Objective-C中改变它的方式:

[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@"AmericanTypewriter" size:20.0f], UITextAttributeFont, nil] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)

但是我怎么能把它翻译成Swift呢?

uitabbar uifont swift

25
推荐指数
4
解决办法
3万
查看次数