GithubHelp home page GithubHelp logo

ladmini / lzviewpager Goto Github PK

View Code? Open in Web Editor NEW
178.0 178.0 29.0 3.37 MB

A powerful paging view with tab bar.

License: MIT License

Swift 89.08% Ruby 10.06% Objective-C 0.85%
ios pager pagerview scrollcontroller swift tabedpager tablayout tabs uicollectionview viewpager viewpages

lzviewpager's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lzviewpager's Issues

Logo Proposal

Good day @ladmini I am a graphic designer and i would like to contribute to your good project by designing a logo for it. I'll be doing it for free if you will allow me Sir..Thanks and best regards!
-Tobaloidee

1.3.2 SPM Bug

The newest version is still showing the SnapKit error when using Swift Package Manager (SPM)

重新載入的時候,會發生Crash

我的數據源(10筆),有異動(變9筆)需要reloadData, 而畫面已經滑動到最後一個, 這時reloadData,會死在
func buttonXLeading(for index: Int) ,因為沒有歸0 , index回傳給我10
需要哥 做個防呆,在 func setUpIndicator() 發現 self.currentIndex > self.dataSource.numberOfItems 要歸零

why causing this error?

Thread 1: "[<UIView 0x7fc42d60d0d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSource."

please help

Title color instead of indicator

Hi!

I would like title color black when active and gray when inactive the page (instead of use indicator).

button.setTitleColor(UIColor.black, for: .selected) button.setTitleColor(UIColor.black.withAlphaComponent(0.2), for: .normal)

This code is working, but my first/ main page title will black/active only when I tap. How can I make the first title "button" active default (100% black)?

Thanks

Proposal: Remove snapkit dependency

What do you think about removing the snapkit dependency and create constraint with the standard UIKit syntax? Will you accept a pull request of this kind?

button text not changing

changing text on viewdidload by doing vc1.title = "home" and vc2.title = "align" but text not changing

LZViewPager Not Obliging by Auto Layout Constraints

Hi,

I'm a recent installer of your library and I ran across an issue where the LZViewPager will not let me create a custom approach, such as modifying the NSLayoutConstraints. I have been trying to create my own layout constraints with the LZViewPager (since my view controller is dynamic) and it won't let me no matter what I do. Here is a snippet of what I am trying to achieve.

let viewHeader = UIView(frame: CGRect(x: 0, y: 0, width: screenWidth, height: 200))
var viewPager = LZViewPager(frame: CGRect(x: 0, y: 0, width: screenWidth, height: 100))
viewPager.translatesAutoresizingMaskIntoConstraints = false

self.view.addSubview(viewPager)
self.view.addSubview(viewHeader)

NSLayoutConstraint.activate([
self.viewHeader.topAnchor.constraint(equalTo: self.view.topAnchor, constant: 0),
self.viewHeader.leadingAnchor.constraint(equalTo: self.view.leadingAnchor, constant: 0),
self.viewHeader.trailingAnchor.constraint(equalTo: self.view.trailingAnchor, constant: 0),
self.viewHeader.heightAnchor.constraint(equalToConstant: 200),

   self.viewPager.topAnchor.constraint(equalTo: self.viewHeader.bottomAnchor, constant: 0),
   self.viewPager.leadingAnchor.constraint(equalTo: self.viewHeader.leadingAnchor, constant: 0),
   self.viewPager.trailingAnchor.constraint(equalTo: self.viewHeader.trailingAnchor, constant: 0),
   self.viewPager.bottomAnchor.constraint(equalTo: self.viewHeader.bottomAnchor, constant: 0),

])

For some reason the above will not allow me to change the LZViewPager's constraints. No matter correctly done the auto layout is. Can you please apply an update to fix this or assist me with this issue? Thanks

Cannot load underlying module for 'LZViewPager'

Hello guys, I'm facing this issue only with a custom build configuration, we have:

Debug: Everything is OK
PRE: KO, we get Cannot load underlying module for 'LZViewPager'
Release: Everything is OK
Any help? Thanks for your job!

如何在父页面,选择要展示的子页面,哪个排第一个

这是个好框架,很简洁,最近遇到一个问题,我的父页面有4个按钮,子页面同样也有4个,我想点击对应的按钮进入后自动将该页面显示出来,我在子页面 viewDidLoad 里面添加了viewPager.select(index: pageViewIndex) pageViewIndex是定义的全局变量,在父页面跳转的时候改变变量来记录选中了哪个.
这样也可以工作,但是子页面间切换的时候title要闪烁,左右滑动也不是按顺序滑动,所以问下这个该怎么解决呢

Can't change for indicator height

Hi,
I was using the function below but it didn't work.

  • func heightForIndicator(at index: Int)

Please let me know if I miss anything.
Thanks,

Pagination Issue.

When i Press Button Fastly of Segments then the Loading of Page Create Issue. Some Time second tab shows ViewController of Third tab ViewController and These Navigation Issue came normaly.

App Crash when comes to LZVewPage Screen

I am using this library in my project and whenever I run my app it is giving me the following error:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIView 0x7fccc110d3e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSource.'

Doesn't show content viewcontroller inside of viewPager

import LZViewPager

class rechargeViewController: BaseViewController, LZViewPagerDelegate, LZViewPagerDataSource{

@IBOutlet weak var viewPager: LZViewPager!


  private var subControllers:[UIViewController] = []
    
override func viewDidLoad() {
        
           super.viewDidLoad()

           let vc1 = UIViewController.createFromNib(storyBoardId: "prePayTypesViewController")!
           vc1.title = "PREPAID"
           let vc2 = UIViewController.createFromNib(storyBoardId: "dthViewController")!
           vc2.title = "DTH"
           let vc3 = UIViewController.createFromNib(storyBoardId: "landLineViewController")!
           vc3.title = "LANDLINE"
           let vc4 = UIViewController.createFromNib(storyBoardId: "broadBandViewController")!
           vc4.title = "BROADBAND"
           let vc5 = UIViewController.createFromNib(storyBoardId: "postPayViewController")!
           vc4.title = "POSTPAY"
           let vc6 = UIViewController.createFromNib(storyBoardId: "autoViewController")!
           vc4.title = "AUTO"
           subControllers = [vc1, vc2, vc3, vc4, vc5, vc6]
           viewPager.hostController = self
           viewPager.reload()

       }

    func numberOfItems() -> Int {
       return self.subControllers.count
   }
   
   func controller(at index: Int) -> UIViewController {
       return subControllers[index]
   }
   
   func button(at index: Int) -> UIButton {
       //Customize your button styles here
       let button = UIButton()
       button.setTitleColor(UIColor.black, for: .normal)
       button.titleLabel?.font = UIFont.systemFont(ofSize: 16)
       return button
   }

           func widthForButton(at index: Int) -> CGFloat {
               return 130
           }

           func willTransition(to index: Int) {
               print("Current index before transition: \(viewPager.currentIndex ?? -1)")
           }

           func didTransition(to index: Int) {
               print("Current index after transition: \(viewPager.currentIndex ?? -1)")
           }

           func didSelectButton(at index: Int) {
               print("Current index before transition: \(viewPager.currentIndex ?? -1)")
               print("Current index after transition: \(index)")
           }

}

how to change Indicator Not Selected Area Color

By Default, it shows White Color for Indicator Which is Not Selected.
Screenshot 2020-12-17 at 4 25 17 PM
I want to Change the Color Of the UnSelected area or I want to make its color Clear.
How to do it. I am not Getting any solution for that.
Please help me as soon as possible.

能否给指示线加一个切换的动画

这个框架很类似Android的ViewPager用法,很亲切

但是指示线 在切换的时候有些生硬,作者能否加上一些随着手滑动,线跟着滑动的动画

LZViewPager doesn't support localization

I've used this library for pageviewcontroller and now im facing issue as i also have localization in my app so when i switch to arabic that is from right to left. The LZViewPager just disappears from navigation bar place. For reference i already used the below code in the same viewcontroller file. But it isnt working. Reply expected as soon as possible. As i have used this in a important project

func buttonsAlignment() -> ButtonsAlignment {
if let lang = Locale.current.languageCode, lang == "ar" || lang == "ur" {
return .center // i have changed and values and tested
} else {
return .center
}
}

Header isn't scrolling

Screen Shot 2020-07-15 at 13 35 09

Following demo, but for some reason header isn't scrolling. On version 1.2.5 Xcode 11.5 if you need any code please let me know

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.