cari

Rumah  >  Soal Jawab  >  teks badan

objective-c - 视图view.window返回当前keywindow吗?

UIView.window属性来源于当前UIApplication.keyWindow,可以通过此属性让UIView间接获取到该视图的UIViewController类。

ringa_leeringa_lee2769 hari yang lalu713

membalas semua(4)saya akan balas

  • PHP中文网

    PHP中文网2017-04-21 11:18:44

    Saya rasa UIView.window mengembalikan tetingkap tempat paparan semasa berada, tidak semestinya tetingkap kunci

    balas
    0
  • 高洛峰

    高洛峰2017-04-21 11:18:44

    self.view.window 只是当前view的window,可能是keywindow
    @property(nonatomic, readonly) UIWindow *window
    Description	
    The receiver’s window object, or nil if it has none. (read-only)
    This property is nil if the view has not yet been added to a window.
    [[UIApplication sharedApplication] keyWindow]
    @property(nonatomic, readonly) UIWindow *keyWindow
    This property holds the UIWindow object in the windows array that is most recently sent the makeKeyAndVisible message.
    [[UIApplication sharedApplication] windows]
    @property(nonatomic, readonly) NSArray *windows
    This property returns an array of the application's visible and hidden windows. The windows are ordered back to front.

    balas
    0
  • 大家讲道理

    大家讲道理2017-04-21 11:18:44

    Jika paparan ialah kawasan tertentu pada papan kekunci, view.window ialah tetingkap papan kekunci.

    balas
    0
  • 怪我咯

    怪我咯2017-04-21 11:18:44

    Tidak semestinya.

    Boleh dinilai melalui view.window.keyWindow.

    balas
    0
  • Batalbalas