小编jxd*_*ter的帖子

如何在其他子视图下方插入子视图

大家.

我有一些标签,我在xib文件中绘制它们,并使用代码添加背景视图,但背景视图位于这些标签的前面,所以我无法看到它们.所以,我的问题是如何在这些标签下面添加背景视图.

先感谢您.

subview addsubview ios

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

iOS TabbarViewController隐藏标签栏

我有一个viewcontroller,它实现了UITabbarViewController,我想隐藏标签栏并自己覆盖它,

self.tabBar.hidden = YES;
Run Code Online (Sandbox Code Playgroud)

标签栏消失但是视图底部有一个空白区域(蓝色区域).我不想要空白区域,我该如何解决这个问题?谢谢.

编辑:蓝色区域是:

self.view.backgroundColor = [UIColor blueColor];
Run Code Online (Sandbox Code Playgroud)

tabbar uitabbarcontroller ios

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

UITabBar将隐藏UITableView的最后一个单元格

self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, [UIScreen mainScreen].bounds.size.height ) style:UITableViewStylePlain];
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

如果我将tableview框架更改为

(0.0, 0.0, 320.0, [UIScreen mainScreen].bounds.size.height -49.0)
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

滚动条会留下空白,我不喜欢它.我怎么能解决这个问题?

非常感谢你.

uitableview uitabbar ios

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

如何在NSString中使用千位分隔符

NSString就像"1000.00"和"1008977.72",

如何将它们格式化为"1,000.00"和"1,008,977.00"

这是我的问题,请帮助我,提前谢谢你.

nsstring ios

14
推荐指数
1
解决办法
8628
查看次数

iOS app applicationWillEnterForeground并且它停留了一段时间

我添加此函数以在应用程序进入前台时发布通知:

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    [[NSNotificationCenter defaultCenter] postNotificationName: @"UIApplicationWillEnterForegroundNotification" object: nil];
}
Run Code Online (Sandbox Code Playgroud)

在我自己的班上:

- (void) handleEnterForeground: (NSNotification*) sender
{
    [self reloadTableData];
}


- (void)viewDidLoad
{
    [super viewDidLoad];
    [[NSNotificationCenter defaultCenter] addObserver: self
                                         selector: @selector(handleEnterForeground:)
                                             name: @"UIApplicationWillEnterForegroundNotification"
                                           object: nil];
}
Run Code Online (Sandbox Code Playgroud)

但是handleEnterForeground:函数会调用两次,我不知道为什么.reloadTableData:函数将调用远程webService,因此当应用程序进入前台时,它会停留一段时间.

background-foreground uiapplicationdelegate ios

9
推荐指数
1
解决办法
8381
查看次数

UIImageView内容模式

在此输入图像描述

蓝线是imageview的界限. UIImageViewcontentModeUIViewContentModeScaleAspectFit,我要保留原始图像的规模.如何让图片的左边缘位于UIImageView左边缘?但不喜欢UIViewContentModeTopLeft模式.保持比例,左边没有空白.我的英语不好,希望你们能理解我在说什么.非常感谢你.

objective-c uiimageview ios

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

UIView addSubview并且不显示子视图

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    HeadViewController *headViewController = [[HeadViewController alloc] initWithNibName:@"HeadViewController" bundle:nil];    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 120)];
    [view addSubview:headViewController.vew];
    [self.view addSubview:view];
}
Run Code Online (Sandbox Code Playgroud)

HeadViewController.h:

@interface HeadViewController : UIViewController
{
    IBOutlet UIView *view;
}
@property (nonatomic, retain)IBOutlet UIView *view;
@end
Run Code Online (Sandbox Code Playgroud)

然后我将视图连接到文件的所有者.

我看不到headViewController.view.

uiview ios

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

自定义UITableViewCell NSUnknownKeyException

- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *TodoListTableIdentifier = @"TodoListTableIdentifier";
    TodoTableViewCellController *cell = (TodoTableViewCellController *)[tableView dequeueReusableCellWithIdentifier:TodoListTableIdentifier];
    if ( cell == nil ) 
    {
        NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"TodoTableViewCellController" owner:self options:nil];
        cell=[nib objectAtIndex:0];
        [cell setSelectionStyle:UITableViewCellSelectionStyleGray];  
    }
    Todo *todo = [self.allTodoArray objectAtIndex:[indexPath row]];


    cell.titleLabel.text = todo.fileTitle;
    cell.money.text = [NSString stringWithFormat:@"Monei:%f",todo.amount];
    cell.name.text = todo.realName;
    cell.date.text = todo.operateTime;

    return cell;
 }
Run Code Online (Sandbox Code Playgroud)

在跑步时:

 NSArray *nib=[[NSBundle mainBundle] loadNibNamed:@"TodoTableViewCellController" owner:self options:nil];
Run Code Online (Sandbox Code Playgroud)

并且有一个例外: *由于未捕获的异常'NSUnknownKeyException'而终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不是关键日期的密钥值编码兼容.

我不知道为什么会发生,所以请帮助我,提前谢谢你!

objective-c uitableview ios

6
推荐指数
1
解决办法
3189
查看次数

UIAlertViewDelegate:clickedButtonAtIndex和两个按钮

球员:

测试应用程序的viewController中有两个按钮,右边一个我称之为"NO",

另一个是"是".这两个按钮将调用两个不同的功能,以及何时

用户按下其中一个按钮,我想向用户显示一个警告以确认.

我知道使用UIAlertViewDelegate

- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
Run Code Online (Sandbox Code Playgroud)

但有两个按钮,我很困惑.我怎么知道按下了哪个按钮.

所以,请帮助我,提前谢谢你!

uialertview ios

6
推荐指数
1
解决办法
6933
查看次数

Xcode5.1.1和Xcode6 beta7 iOS7.1 64位[Allocator]分配器无效,回退到malloc

[Allocator] Mapping failed %d
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to malloc
[Allocator] Allocator invalid, falling back to …
Run Code Online (Sandbox Code Playgroud)

xcode ios ios7

6
推荐指数
1
解决办法
1090
查看次数