ladmini / lzviewpager Goto Github PK
View Code? Open in Web Editor NEWA powerful paging view with tab bar.
License: MIT License
A powerful paging view with tab bar.
License: MIT License
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
How we can change the Selected Tab Text Color or when we swipe auto change the current tab text Color.
Color must be custom. Please let me know as soon as possible.
The newest version is still showing the SnapKit error when using Swift Package Manager (SPM)
我的數據源(10筆),有異動(變9筆)需要reloadData, 而畫面已經滑動到最後一個, 這時reloadData,會死在
func buttonXLeading(for index: Int) ,因為沒有歸0 , index回傳給我10
需要哥 做個防呆,在 func setUpIndicator() 發現 self.currentIndex > self.dataSource.numberOfItems 要歸零
Thread 1: "[<UIView 0x7fc42d60d0d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dataSource."
please help
When we change the App Language, title of Viewcontroller not showing up.
Can you increase the adaptive text width?
kindly provide a way to stop scrolling of headerview vertically.(where the button appears for switching page)
I'm trying to make my buttons in header look like chips so i need to add space between my buttons. But i can't find a way to do so.
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
Hello
@ladmini
how to clear color line gray between viewController in switch pager scroll?
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?
changing text on viewdidload by doing vc1.title = "home" and vc2.title = "align" but text not changing
i'm trying to enable scrollable header but i cant. tell me how to enable that.
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
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要闪烁,左右滑动也不是按顺序滑动,所以问下这个该怎么解决呢
When i tried to flip the screen right to left then header is hidden. Is there any way to rectify this problem?
8 No such module 'SnapKit'
Missing package product 'SnapKit'
Hi,
I was using the function below but it didn't work.
Please let me know if I miss anything.
Thanks,
Also, how would I set height for the indicator? Thanks.
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.
can you help me
i need open third tap in ViewDidload() Screen LZViewPager
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.'
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)")
}
}
hi, kindly support on swift 5 ya
delegate 和dataSource 沒有宣告成weak 導致 memory leak,麻煩修正一下
Hi @ladmini
Thank you for your pager. Great!
How can i use select(index: Int)? I have used a viewpager in a viewpager. How can i redirect to parent other tab from child / child viewController.
func select(index: Int)
don't working. https://d.pr/i/diSUpn
I am sorry my bad english.
这个框架很类似Android的ViewPager用法,很亲切
但是指示线 在切换的时候有些生硬,作者能否加上一些随着手滑动,线跟着滑动的动画
demo工程跑不起来!
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
}
}
8 No such module 'SnapKit'
Missing package product 'SnapKit'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.