小编poo*_*rat的帖子

如何在ios 8中获取键盘位置并在numberPad上添加DONE按钮

我使用下面的代码从视图中获取键盘位置并在其上添加DONE按钮.但是在ios 8中它无法获得键盘位置,因此不会添加DONE按钮.

UIWindow *tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];

UIView *keyboard;

for (int i = 0; i < [tempWindow.subviews count]; i++)
{
    keyboard = [tempWindow.subviews objectAtIndex:i];
    // keyboard view found; add the custom button to it

    if ([[keyboard description] hasPrefix:@"<UIPeripheralHostView"] == YES)
    {
        [keyboard addSubview:doneButton];
    }
}
Run Code Online (Sandbox Code Playgroud)

keyboard ios8

5
推荐指数
1
解决办法
6953
查看次数

在swift中将表头添加到tableview

我想将标题添加到tableview而不是swift中的部分.我的类是UITableViewController的子类.我想保持标题部分固定和其他部分可滚动.

scroll uitableview swift

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

如何快速获取数组中字典的值

我有这样的字典

var dict : [String : Array<String>] = ["Fruits" : ["Mango", "Apple", "Banana"],"Flowers" : ["Rose", "Lotus","Jasmine"],"Vegetables" : ["Tomato", "Potato","Chilli"]]
Run Code Online (Sandbox Code Playgroud)

我想在每个键的数组中获取值如何快速获取?

arrays dictionary swift ios8

-4
推荐指数
1
解决办法
1万
查看次数

标签 统计

ios8 ×2

swift ×2

arrays ×1

dictionary ×1

keyboard ×1

scroll ×1

uitableview ×1