小编Hor*_*tio的帖子

有没有办法在没有Android按钮的情况下使用Twitter数字?

我正在制作一个使用Twitter数字的应用程序,我想知道是否有办法使用它而不使用丑陋的Twitter数字按钮,上面写着" 使用我的电话号码 "

java android twitter-digits

6
推荐指数
2
解决办法
2329
查看次数

UICollectionView单元重叠swift

我正在创建一个UICollectionView,但是当一个新单元格添加到视图时,它与前一个单元格部分重叠.以下是我的代码:

 override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {


    let cell = collectionView.dequeueReusableCellWithReuseIdentifier("CustomCell", forIndexPath: indexPath) as! CustomCell

    cell.frame.size.width = self.view.frame.width / 3
    cell.frame.size.height = self.view.frame.height / 4
    cell.backgroundView = imageView
    return cell

}
Run Code Online (Sandbox Code Playgroud)

如何确保细胞不重叠?

uikit ios uicollectionview swift

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

如何使NSNotificationCenter仅在选择某个UITextField时运行

NSNotificationCenter当键盘显示时,我用来移动主视图框.

但是,我只想让它在UITextField选择一个时工作.

这是我到目前为止:

func getKeyboardHeight(notification: NSNotification) -> CGFloat {
    let userInfo = notification.userInfo

    let keyboardSize = userInfo![UIKeyboardFrameEndUserInfoKey] as! NSValue

    return keyboardSize.CGRectValue().height

}

func keyboardWillShow(notification: NSNotification) {
    self.view.frame.origin.y -= getKeyboardHeight(notification)
}

func keyboardWillHide(notification: NSNotification) {
    self.view.frame.origin.y += getKeyboardHeight(notification)
}

func subscribeToKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil)
}

func unsubscribeToKeyboardNotifications() {
    NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillShowNotification, object: nil)
}

func subscribeToKeyboardHide() {
    NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillHide:", name: UIKeyboardWillHideNotification, object: nil)
}

func unsubscribeToKeyboardHide() {
    NSNotificationCenter.defaultCenter().removeObserver(self, name: UIKeyboardWillHideNotification, object: nil) …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa nsnotificationcenter ios swift

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