Skip to content

Commit

Permalink
Reset the table height
Browse files Browse the repository at this point in the history
  • Loading branch information
DuckDeck committed Feb 27, 2016
1 parent 735e30c commit 2ba28fe
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions GrandMenu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "GrandMenu"
s.version = "0.0.2"
s.version = "0.0.3"
s.summary = "GrandMenu is a powerful and simple Menu"

# This description is used to generate tags and improve search results.
Expand Down Expand Up @@ -80,7 +80,7 @@ Pod::Spec.new do |s|
# Supports git, hg, bzr, svn and HTTP.
#

s.source = { :git => "https://github.com/DuckDeck/GrandMenu.git", :tag => "0.0.2" }
s.source = { :git => "https://github.com/DuckDeck/GrandMenu.git", :tag => "0.0.3" }


# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
Expand Down
10 changes: 6 additions & 4 deletions GrandMenu/GrandMenu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public class GrandMenu: UIView,GraneMenuItemDelegate {
private var scrollView:UIScrollView?
private var arrItems:[GrandMenuItem]?
private var vSlider:UIView?
private var vBottomLine:UIView?
private var selectedItem:GrandMenuItem?{
willSet{
selectedItem?.selected = false //这个警告可以无视
Expand Down Expand Up @@ -137,10 +138,11 @@ public class GrandMenu: UIView,GraneMenuItemDelegate {
arrItemsTitle = titles
setupItems()
}
public func addBottomLine(bgColor:UIColor,height:Float){
let line = UIView(frame: CGRect(x: CGFloat(0), y: CGRectGetMaxY(self.frame), width: UIScreen.mainScreen().bounds.width, height: CGFloat(height)))
line.backgroundColor = bgColor
self.superview?.addSubview(line)
public func addBottomLine(bgColor:UIColor,size:CGSize){
vBottomLine = UIView(frame: CGRect(x: (self.frame.size.width - size.width) / 2, y: self.frame.size.height, width: size.width, height: size.height))
vBottomLine?.backgroundColor = bgColor
addSubview(vBottomLine!)
self.frame = CGRect(x: self.frame.origin.x, y: self.frame.origin.y, width: self.frame.size.width, height: CGRectGetMaxY(vBottomLine!.frame))
}

func setupItems(){
Expand Down
4 changes: 3 additions & 1 deletion GrandMenuDemo/GrandMenuDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class ViewController: UIViewController {
grandMenu?.sliderBarLeftRightOffset = 15
grandMenu?.itemSelectedFont = 16
view.addSubview(grandMenu!)
// grandMenu?.addBottomLine(UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 0.6), height: 5)
grandMenu?.addBottomLine(UIColor(red: 0.6, green: 0.6, blue: 0.6, alpha: 0.6), size: CGSize(width: 200, height: 1))
arrControllers = [UIViewController]()
let vc1 = Controller1()
let vc2 = Controller2()
Expand All @@ -41,7 +43,7 @@ class ViewController: UIViewController {
arrControllers?.append(vc3)
arrControllers?.append(vc4)
arrControllers?.append(vc5)
grandMenuTable = GrandMenuTable(frame: CGRect(x: 0, y: 104, width: UIScreen.mainScreen().bounds.size.width, height: view.frame.size.height - 104), arrContent: arrControllers!)
grandMenuTable = GrandMenuTable(frame: CGRect(x: 0, y: CGRectGetMaxY(grandMenu!.frame), width: UIScreen.mainScreen().bounds.size.width, height: view.frame.size.height - 104), arrContent: arrControllers!)
grandMenuTable?.scrollToIndex = scrollToIndex
view.addSubview(grandMenuTable!)
}
Expand Down

0 comments on commit 2ba28fe

Please sign in to comment.