You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi wangmchn, I don't know whether it's a bug that contentView's origin not starts with x:0 when I set showOnNav with a rightView. So I make a PR with some color to mark their frames, just like
In my solution:
publicclassMenuView:UIView,MenuItemDelegate{
// MARK: - Public vars
overridepublicvarframe:CGRect{
didSet {guard contentView !=nilelse{return}
// FIXME: - reset contentView's x will cause a bug that contentView won't start from x: 0, remove them and works!
/**
// Make the contentView center, because system will change menuView's frame if it's a titleView.
if (contentView.frame.origin.x + contentView.frame.width / 2) != (bounds.origin.x + bounds.width / 2) {
var contentFrame = contentView.frame
contentFrame.origin.x = bounds.origin.x - (contentFrame.width - bounds.width) / 2
contentView.frame = contentFrame
}
*/
}}
I know that adding those codes' reason, but contentView still center its frame after I remove those codes, I wonder whether some code has fixed it. My PR project will show the bug, you can check it out and remove those codes to test it. Thanks.
hi wangmchn, I don't know whether it's a bug that contentView's origin not starts with x:0 when I set showOnNav with a rightView. So I make a PR with some color to mark their frames, just like
In my solution:
public class MenuView: UIView, MenuItemDelegate {
// MARK: - Public vars
override public var frame: CGRect {
didSet {
guard contentView != nil else { return }
// FIXME: - reset contentView's x will cause a bug that contentView won't start from x: 0, remove them and works!
/**
// Make the contentView center, because system will change menuView's frame if it's a titleView.
if (contentView.frame.origin.x + contentView.frame.width / 2) != (bounds.origin.x + bounds.width / 2) {
var contentFrame = contentView.frame
contentFrame.origin.x = bounds.origin.x - (contentFrame.width - bounds.width) / 2
contentView.frame = contentFrame
}
*/
}
}
I know that adding those codes' reason, but contentView still center its frame after I remove those codes, I wonder whether some code has fixed it. My PR project will show the bug, you can check it out and remove those codes to test it. Thanks.
You can view, comment on, or merge this pull request online at:
menuViews frame origin.x bugfix control menuView as subView of navigationBar menuViews frame origin.x bugfix
control menuView as subView of navigationBar
hows the origin bug when setting the rightView in NavBar
Merge branch 'master' of https://github.com/litt1e-p/WMPageController-Swift
hows the origin bug when setting the rightView in NavBar
File Changes
A .DS_Store (0)
A Example/Use Code/.DS_Store (0)
M PageController/MenuItem.swift (3)
M PageController/MenuView.swift (3)
A StoryboardExample/.DS_Store (0)
M StoryboardExample/StoryboardExample/Base.lproj/Main.storyboard (3)
M StoryboardExample/StoryboardExample/ParentController/CustomPageController.swift (7)
Patch Links:
hi wangmchn, I don't know whether it's a bug that contentView's origin
not starts with x:0 when I set showOnNav with a rightView. So I make a PR
with some color to mark their frames, just like
In my solution:
public class MenuView: UIView, MenuItemDelegate {
// MARK: - Public vars
override public var frame: CGRect {
didSet {
guard contentView != nil else { return }
// FIXME: - reset contentView's x will cause a bug that contentView
won't start from x: 0, remove them and works!
/**
// Make the contentView center, because system will change menuView's
frame if it's a titleView.
if (contentView.frame.origin.x + contentView.frame.width / 2) !=
(bounds.origin.x + bounds.width / 2) {
var contentFrame = contentView.frame
contentFrame.origin.x = bounds.origin.x - (contentFrame.width -
bounds.width) / 2
contentView.frame = contentFrame
}
*/
}
}
I know that adding those codes' reason, but contentView still center its
frame after I remove those codes, I wonder whether some code has fixed it.
My PR project will show the bug, you can check it out and remove those
codes to test it. Thanks.
You can view, comment on, or merge this pull request online at:
menuViews frame origin.x bugfix control menuView as subView of navigationBar menuViews frame origin.x bugfix
control menuView as subView of navigationBar
hows the origin bug when setting the rightView in NavBar
Merge branch 'master' of https://github.com/litt1e-p/WMPageController-Swift
hows the origin bug when setting the rightView in NavBar
File Changes
A .DS_Store (0)
A Example/Use Code/.DS_Store (0)
M PageController/MenuItem.swift (3)
M PageController/MenuView.swift (3)
A StoryboardExample/.DS_Store (0)
M StoryboardExample/StoryboardExample/Base.lproj/Main.storyboard (3)
M
StoryboardExample/StoryboardExample/ParentController/CustomPageController.swift
(7)
Patch Links:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hi wangmchn, I don't know whether it's a bug that contentView's origin not starts with x:0 when I set showOnNav with a rightView. So I make a PR with some color to mark their frames, just like
In my solution:
I know that adding those codes' reason, but contentView still center its frame after I remove those codes, I wonder whether some code has fixed it. My PR project will show the bug, you can check it out and remove those codes to test it. Thanks.