dsxNiubility / SXNews

High imitation Neteasy News. (include list,detail,photoset,weather,feedback)
MIT License
3.58k stars 1.06k forks source link

为什么单独拿出来使用下面代码时不起作用? #16

Open mandy04 opened 8 years ago

mandy04 commented 8 years ago
UIWindow *win = [UIApplication sharedApplication].windows.firstObject;
[win addSubview:rightItem];
dsxNiubility commented 8 years ago

用[UIApplication sharedApplication].keyWindow试试。 你说的不起作用也许是你没看见,可以用Debug的Capture View Hierarchy看看是否被挡住了

seasaliu commented 8 years ago

UIWindow *win = [UIApplication sharedApplication].windows.firstObject;是最下面的一个窗口。[UIApplication sharedApplication].windows.lastObjec才是界面最前面的窗口。