我使用下面的代码从视图中获取键盘位置并在其上添加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) 我想将标题添加到tableview而不是swift中的部分.我的类是UITableViewController的子类.我想保持标题部分固定和其他部分可滚动.
我有这样的字典
var dict : [String : Array<String>] = ["Fruits" : ["Mango", "Apple", "Banana"],"Flowers" : ["Rose", "Lotus","Jasmine"],"Vegetables" : ["Tomato", "Potato","Chilli"]]
Run Code Online (Sandbox Code Playgroud)
我想在每个键的数组中获取值如何快速获取?