我正在使用python为windows编写简单的托盘.
我成功创建了一个托盘图标,菜单,子菜单.我坚持为特定的托盘项目添加图像.
这是我用过的代码.(链接)即使这段代码也行不通.Windows文档不清楚.
def addMenuItem(self, wID, title, menu):
path = os.path.dirname(os.path.abspath(__file__))
path += "\print_pref.ico"
option_icon = self.prep_menu_icon(path)
item, extras = win32gui_struct.PackMENUITEMINFO(text=title,
hbmpItem=option_icon,
wID=wID)
win32gui.InsertMenuItem(menu, 0, 1, item)
def prep_menu_icon(self, icon):
# First load the icon.
ico_x = win32api.GetSystemMetrics(win32con.SM_CXSMICON)
ico_y = win32api.GetSystemMetrics(win32con.SM_CYSMICON)
hicon = win32gui.LoadImage(0, icon, win32con.IMAGE_ICON, ico_x, ico_y, win32con.LR_LOADFROMFILE)
hdcBitmap = win32gui.CreateCompatibleDC(0)
hdcScreen = win32gui.GetDC(0)
hbm = win32gui.CreateCompatibleBitmap(hdcScreen, ico_x, ico_y)
hbmOld = win32gui.SelectObject(hdcBitmap, hbm)
# Fill the background.
brush = win32gui.GetSysColorBrush(win32con.COLOR_MENU)
win32gui.FillRect(hdcBitmap, (0, 0, 16, 16), brush)
# …Run Code Online (Sandbox Code Playgroud) 我检查了最新的Dropbox和Excel for iOS.在Dropbox中,我们得到一个编辑按钮.单击它会打开Excel的扩展,您可以在其中编辑文件.
保存后,更改也会反映在Dropbox文件中.
我想添加这样一个按钮.此外,我想在图像中添加这样一个按钮,以便在可用的"照片编辑"应用程序中打开它们.
如何检查文件(图像,xls,doc或任何其他)是否可以打开进行编辑?
代码到目前为止:
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithURL:url inMode:UIDocumentPickerModeExportToService];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
还尝试将模式改为UIDocumentPickerModeMoveToService......

根据apple docs移动本地文档.用户选择外部目的地.文件选择器移动文件; 但是,您仍然可以将文档作为外部文档访问,让用户可以编辑文档.
但我尝试了所有四种模式.没有显示excel选项.
UIDocumentPickerModeImport,
UIDocumentPickerModeOpen,
UIDocumentPickerModeExportToService,
UIDocumentPickerModeMoveToService
Run Code Online (Sandbox Code Playgroud) 我刚刚开始将我的应用程序移动到autolayout.我想约束导航栏下面的标签'0'像素.我试过但没有找到解决方案.这是屏幕截图.
在故事板中,我给了superview一个约束.
在IOS7中,它工作正常.

但是在IOS6中它会在导航栏下方64像素,因为superview从导航栏下面开始.

如果我可以为导航栏下面的标签添加顶部约束,它将解决问题.但我无法找到如何做到这一点.我搜索了几个问题.但是他得到了答案.
请帮忙.
我用来keychain进行身份验证,然后将位置信息发送到后台服务器。
但自从kSecAttrAccessibleAlways被贬低后,我将不得不使用kSecAttrAccessibleAfterFirstUnlock. 这允许在重新启动手机后首次解锁后使用keychain。
问题是,如果用户重新启动手机,并且在首次解锁之前位置发生更改,则身份验证将失败,因为我们无法从keychain.
我怎么解决这个问题。如何发现keychain无法访问并停止身份验证过程。
谢谢。
我有两个NSSet.一个包含所有UserKeys,另一个包含在线用户密钥.我想在这两个部分中显示这些值.第1节 - 在线用户和第2节 - 其他用户
我使用下面的谓词做了这个.
NSSet *nsset1 = [NSSet setWithArray:attendeesService.arrof_attendeeList]; //this are all users
nsset2 = [NSSet setWithArray:tempArray]; // temparray contains all online users.
NSSet *nsset2_ids = [nsset2 valueForKey:@"UserProfileKEY"];
nsset1_minus_nsset2 = [nsset1 filteredSetUsingPredicate:[NSPredicate predicateWithFormat:@"NOT UserProfileKEY IN %@",nsset2_ids]];
Run Code Online (Sandbox Code Playgroud)
它工作正常.但是所有用户大约3000+,在线可能一次超过200+.所以需要花费很多时间.4-5名在线用户需要1分钟.因此,200多名在线用户将花费更多时间.有更快的解决方案吗?
谢谢.
ios ×4
autolayout ×1
excel ×1
ios9 ×1
keychain ×1
nspredicate ×1
nsset ×1
python ×1
systray ×1
uidocument ×1
win32gui ×1
windows ×1