maxep / mxsegmentedpager Goto Github PK
View Code? Open in Web Editor NEWSegmented pager view with Parallax header
License: MIT License
Segmented pager view with Parallax header
License: MIT License
Hi @maxep
I have two ViewControllers
loaded by MXSegmentedPage
; in all this two ViewControllers
can be played a video flow by the user.
When user change the current tab I have to pause the played video for the hidden tab.
I've thinked to put my logic into the ViewController
waiting for a viewWillAppear
/viewDidAppear
call for the current selected tab and a viewWillDisappear
/viewDidDisappear
for the previous selected tab, but this methods aren't called right now.
Can you help me?
Thanks
Hi @maxep
in this last two days I'm fighting with some memory leaks in my application, but I think this leaks depends by MXSegmentedPager
.
So I've downloaded the MXSegmentedPager-Swift
sample and I've added a new NavigationController
with a button in the NavigationBar
; this button will push your MXViewController
.
Profile > Allocations
inspector and before start I've checked the "Record reference counts" option; here the Inspector
after launching the application (it's cleaned):MXViewController
in the Navigation Controller:Root View Controller
:Root View Controller
but this time I've opened and closed the MXViewController
subview for 10 times.Can you help me?
I'm trying to setup view pager. i returning 4 pages at number method , same title for every page and same tableview for every page.
P.S : I'm not using storyboards.
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: 0)'
*** First throw call stack:
(
0 CoreFoundation 0x000000010800cf65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109971deb objc_exception_throw + 48
2 CoreFoundation 0x0000000107f0ad72 -[__NSDictionaryM setObject:forKey:] + 1042
3 MXSegmentedPager 0x0000000108e176d1 __31-[MXPagerView loadPageAtIndex:]_block_invoke + 657
4 MXSegmentedPager 0x0000000108e173c3 -[MXPagerView loadPageAtIndex:] + 131
5 MXSegmentedPager 0x0000000108e1602c -[MXPagerView reloadData] + 876
6 MXSegmentedPager 0x0000000108e19a03 -[MXSegmentedPager reloadData] + 1299
7 MXSegmentedPager 0x0000000108e1876f -[MXSegmentedPager layoutSubviews] + 63
8 UIKit 0x0000000109e8911c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
9 QuartzCore 0x000000010912b36a -[CALayer layoutSublayers] + 146
10 QuartzCore 0x000000010911fbd0 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
11 QuartzCore 0x000000010911fa4e _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
12 QuartzCore 0x00000001091141d5 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
13 QuartzCore 0x00000001091419f0 _ZN2CA11Transaction6commitEv + 508
14 QuartzCore 0x0000000109142154 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
15 CoreFoundation 0x0000000107f389d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
16 CoreFoundation 0x0000000107f38947 __CFRunLoopDoObservers + 391
17 CoreFoundation 0x0000000107f2e59b __CFRunLoopRun + 1147
18 CoreFoundation 0x0000000107f2de98 CFRunLoopRunSpecific + 488
19 GraphicsServices 0x000000010d898ad2 GSEventRunModal + 161
20 UIKit 0x0000000109dd8676 UIApplicationMain + 171
21 FoodKlik 0x00000001068766df main + 111
22 libdyld.dylib 0x000000010b3af92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Hi, when I dismissed the modal View Controller containing the MXSegmentPager instance, application crashed with the following error.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x151e9000 of class MXScrollView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x16259d70> (...)'
Based on the issue here: stoprocent/VGParallaxHeader#29 is there a chance you can update to using your fork of VGParallaxHeader so that updating the header height works correctly? If not, I'll have to fork MXSegmentedPager and use your fork of VGParallaxHeader in order to fix the issues I'm seeing.
Hello, first let me say just thank for creating this awesome project.
I have been figthing with these issue a couple of days now, a ViewController that loads a simple segmented Pager, the first "panel" is loaded from a TableView in the storyboard, when I run the application the data stay on the view only if I do not scroll down, if for some reason I do it, then the cell erase all the labels.
Could you please, take a look and give me some advice.
ViewController.h
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end
ViewController.m
#import "ViewController.h"
#import "MXSegmentedPager.h"
#import "Parse.h"
#import "ParseUI.h"
#import "myCustomCell.h"
@interface ViewController () <MXSegmentedPagerDelegate, MXSegmentedPagerDataSource, UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) MXSegmentedPager * segmentedPager;
@property (nonatomic, strong) UITableView * tableView;
@property (nonatomic, strong) UITableView * tomorrow;
@property (nonatomic, strong) UITableView * week;
@property (nonatomic, strong) UITableView *ppp;
@property (nonatomic, strong) UITableView *ptabla;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.navigationController.navigationBar.translucent = NO;
//self.title = @"Fixtures";
// Setup the segmented pager properties
self.segmentedPager.delegate = self;
self.segmentedPager.dataSource = self;
self.segmentedPager.segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
self.segmentedPager.segmentedControl.backgroundColor = [UIColor colorWithRed:0.7 green:0.7 blue:0.7 alpha:1];
self.segmentedPager.segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor blackColor]};
self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
self.segmentedPager.segmentedControl.selectionIndicatorColor = [UIColor colorWithRed:0.3 green:0.3 blue:0.3 alpha:1];
[self.view addSubview:self.segmentedPager];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma -mark Properties
- (MXSegmentedPager *)segmentedPager {
if (!_segmentedPager) {
// Set a segmented pager
_segmentedPager = [[MXSegmentedPager alloc] initWithFrame:(CGRect){
.origin = CGPointZero,
.size.width = self.view.frame.size.width,
.size.height = self.view.frame.size.height - 64.f
}];
}
return _segmentedPager;
}
- (UITableView *)ppp {
if (!_ppp) {
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"re" bundle:nil];
UITableViewController* theController = [storyboard instantiateViewControllerWithIdentifier:@"fff"];
_ppp = theController.tableView;
}
return _ppp;
}
- (UITableView *)tableView {
if (!_tableView) {
//Add a table page
_tableView = [[UITableView alloc] initWithFrame:(CGRect){
.origin = CGPointZero,
.size = self.segmentedPager.containerSize
}];
_tableView.delegate = self;
_tableView.dataSource = self;
}
return _tableView;
}
- (UITableView *)tomorrow {
if (!_tomorrow) {
//Add a table page
_tomorrow = [[UITableView alloc] initWithFrame:(CGRect){
.origin = CGPointZero,
.size = self.segmentedPager.containerSize
}];
_tomorrow.delegate = self;
_tomorrow.dataSource = self;
}
return _tomorrow;
}
- (UITableView *)week {
if (!_week) {
//Add a table page
_week = [[UITableView alloc] initWithFrame:(CGRect){
.origin = CGPointZero,
.size = self.segmentedPager.containerSize
}];
_week.delegate = self;
_week.dataSource = self;
}
return _week;
}
/*
- (void) segmentedPager:(MXSegmentedPager*)segmentedPager didSelectViewWithIndex:(NSInteger)index {
if(index == 0){
NSLog(@"Selecciono el cero");
}
if(index == 1){
NSLog(@"Selecciono el 1");
}
if(index == 2){
NSLog(@"Selecciono el 2");
}
}
*/
#pragma -mark <MXSegmentedPagerDataSource>
- (NSInteger)numberOfPagesInSegmentedPager:(MXSegmentedPager *)segmentedPager {
return 3;
}
- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {
return [@[@"Today", @"Tomorrow", @"Week"] objectAtIndex:index];
}
- (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex:(NSInteger)index {
return [@[self.ppp, self.tomorrow, self.week] objectAtIndex:index];
}
#pragma -mark <UITableViewDelegate>
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 50;
}
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
//MXSimpleViewController *simpleViewController = [[MXSimpleViewController alloc] init];
//[self.navigationController pushViewController:simpleViewController animated:YES];
}
#pragma -mark <UITableViewDataSource>
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
myCustomCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];
if(!cell)
{
[tableView registerNib:[UINib nibWithNibName:@"customCell" bundle:nil] forCellReuseIdentifier:@"myCell"];
cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];
tableView.rowHeight = cell.frame.size.height;
}
cell.local.text = [NSString stringWithFormat:@"Row %ld", (long)indexPath.row];
cell.visitante.text = [NSString stringWithFormat:@"Row %ld", (long)indexPath.row];
return cell;
}
The "fff" TableViewController only set the value of two labels in a prototype cell. But the ideal behavior will be getting the data out of Parse
Thanks and sorry for my english
Hi @maxep, sorry for the massive number of issues I'm opening in those days :(
I'm having a rendering problem when using MXSegmentedPager
without the parallax header and with an Translucent
Navigation Bar
.
You can reprocude the same bug using the MXSegmentedPager-Swift
sample.
Navigation Controller
in the Main.storyboard
Navigation Controller
as the Initial View Controller
MXViewController
as the root view controller
of the Navigation Controller
.Navigation Controller
select the Navigation Bar
component and enable Translucent
from the Attributes inspector
Last step: comment out all parallaxHeader
settings from the MXViewController.swift
file and run.
The last two rows (Row 48 and Row 49) is partially hidden on the bottom of the view
Hello,
Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x21dc73fb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(300)]>",
"<NSLayoutConstraint:0x24863bfb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(>=600)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x24863bfb0 V:[PrcmQA.NewUserInfoView:0x21dbebe80(>=600)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Thanks for your advice.
In MXPagerView class you registered self as KVO observer in - (instancetype)init:
[self addObserver:self forKeyPath:NSStringFromSelector(@selector(contentOffset))
options:NSKeyValueObservingOptionNew|NSKeyValueObservingOptionOld
context:kMXPagerViewKVOContext];
[self addObserver:self forKeyPath:NSStringFromSelector(@selector(contentSize))
options:0
context:kMXPagerViewKVOContext];
But in - (void)dealloc you forgot to removeObserver. This will lead to crash.
pod update not downloading the latest update...please update the pod to the latest commit...Thanks
I got this working last time by adding the views programmatically (not hooking up MXSegmentedPager in the storyboard). I have some pretty complex view controllers in my app, and I am trying to hook up MXSegmentedPager to an outlet in storyboard, where the top and bottom constraints change.
I have found that the segmented control needs constraints. I added this to - (HMSegmentedControl *)segmentedControl method:
_segmentedControl.translatesAutoresizingMaskIntoConstraints = NO;
NSDictionary *binding = @{@"v" : _segmentedControl};
[self addConstraints:[NSLayoutConstraint
constraintsWithVisualFormat:@"H:|-0-[v]-0-|"
options:NSLayoutFormatDirectionLeadingToTrailing
metrics:nil
views:binding]];
[self addConstraints:[NSLayoutConstraint
constraintsWithVisualFormat:@"V:|-0-[v(50)]"
options:NSLayoutFormatDirectionLeadingToTrailing
metrics:nil
views:binding]];
which works well. But only in the case that there is no ParallaxHeader.
I am having trouble adding the constraints to the MXSegmentedPager+ParallaxHeader.m file, when a parallax header exists. No matter where I add them, things blow up.
Hi @maxep
How to add icon with title in tabs in vertical manner like icon at top and title at bottom? I tried setting up icons in this way but icons are not visible only title is displayed.
- (void)viewDidLoad {
[super viewDidLoad];
self.segmentedPager.backgroundColor = [UIColor whiteColor];
self.segmentedPager.pager.transitionStyle = MXPagerViewTransitionStyleScroll;
self.segmentedPager.segmentedControl.backgroundColor = [UIColor colorWithRed: 244.f/255.f green:67.f/255.f blue:54.f/255.f alpha:1.f];
self.segmentedPager.segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor colorWithRed:0.1 green:0.1 blue:0.1 alpha:1]};
self.segmentedPager.segmentedControl.selectionIndicatorColor = [UIColor whiteColor];
self.segmentedPager.segmentedControlPosition = MXSegmentedControlPositionTop;
self.segmentedPager.segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
self.segmentedPager.segmentedControl.selectionStyle = HMSegmentedControlSelectionStyleFullWidthStripe;
self.segmentedPager.segmentedControl.selectedTitleTextAttributes = @{NSForegroundColorAttributeName : [UIColor whiteColor]};
self.segmentedPager.segmentedControl.selectionIndicatorHeight = 2.f;
}
- (void)viewWillLayoutSubviews {
self.segmentedPager.frame = (CGRect){
.origin = CGPointZero,
.size = self.view.frame.size
};
[super viewWillLayoutSubviews];
}
- (NSString *)segmentedPager:(MXSegmentedPager *)segmentedPager titleForSectionAtIndex:(NSInteger)index {
//return (index < 1)? @"Room Furniture": @"In The Rack";
return [@[@"TAB1",@"TAB2",@"TAB3", @"TAB4", @"TAB5", @"TAB6", @"TAB7", @"TAB8", @"TAB9"] objectAtIndex:index];
}
- (UIImage*) segmentedPager:(MXSegmentedPager*)segmentedPager imageForSectionAtIndex:(NSInteger)index{
//return (index < 1)? ;
NSLog(@"imageForSectionAtIndex -----%ld",(long)index);
self.imageNames = @[@"tab1.png",
@"tab2.png",
@"tab3.png",
@"tab4.png",
@"tab5.png",
@"tab6.png",
@"tab7.png",
@"tab8.png",
@"tab9.png"];
self.imagesURL = [[NSMutableArray alloc ]init];
for (int i=0; i<self.imageNames.count; i++) {
NSString*file = [NSString stringWithFormat:@"%@",[self.imageNames objectAtIndex:i]];
[self.imagesURL addObject:[UIImage imageNamed:file]];
// NSLog(@"MY image ----------%@",[UIImage imageNamed:file]);
}
return [self.imagesURL objectAtIndex:index];
}
It doesn't look like all the latest code is in the latest podspec. Can you bump the version of the podspec so we can get the latest?
Hi, I think I've found a bug in the latest version 3.0.1.
In my MXSegmentedPagerController
subclass I have just one page when the ViewController
is loaded, but after a while (when a remote feed is loaded) I need to add another page.
Even if I call self.segmentedPager.reloadData()
the segmentedControl
view doesn't update itself, until I manually swipe into the first item.
Somebody can help me?
Thanks.
Hi,
my navigationBar
is translucent
and when I scroll down my tableview, the segmentedControl
may disappear under the navigationBar
I am a novice programmer and I would fix this on a fork if I could. But it seems like constraints to its superview are not being set within the control.
I did get the control working in Storyboard. But when I use it in the detail view controller for a UISplitViewController, then rotate the view from portrait to landscape, the width of the control does not resize. I set the constraints from the MXSegmentedPager to its superview, but within the MXSegmentedPager itself, it doesn't seem like there are constraints set for the various components.
Again, I would do it if I knew how. Just learning all of this.
Thanks again for this great control.
I added the pager to my swift project using cocoapods. The error in title appears when building the pod. I tried to install HMSegmentedControl as a seperate (sibling) dependency, but the result is the same. Any idea how I could fix this?
Hi @maxep
Once again thanks for the awesome library...Is it possible to reuse the view controller..the way we reuse the uiview...my task is to create dynamic list of products under different categories which are dynamic..So i want to use a viewcontroller which has tableview in it and reuse that viewcontroller for multiple categories...
Thanks
I tried to set the frame of segmentedControl but it does work.
self.segmentedPager.segmentedControl.frame = CGRectMake(10, 10, 300, 60);
everytime its showing could not build objective-c module MXSegementedPager. Please solve this issue
When using parallax, if I create a UIViewController with a tableview inside as one of the pages, the tableview scrolls it's content when scrolling up (before hitting the top).
In the video below, the first page is a regular tableView which works correctly. The 'top' tab is a UIViewController with a tableView inside and displays how the tableView content is scrolling with the outer scrollView incorrectly.
The contentOffset changes when the iPad rotates or when the detail view of a UISplitviewController is expanded to fill the width of the screen. The change in contentOffset sets off this sequence
-[MXPagerView observeValueForKeyPath:ofObject:change:context:]
-[MXPagerView didScrollFromPosition:ToPosition:]
-[MXPagerView setIndex:]
-[MXSegmentedPager pagerView:didMoveToPageAtIndex:]
which calls:
[self.segmentedControl setSelectedSegmentIndex:index animated:NO];
So when I rotate the iPad or expand the detailView of a UISplitviewController to fill the screen, a different segment of the segmentedControl is often selected (sometimes it does not switch, but in many/most cases it does).
Does MXSegmentedPager remove the navigation controller from displaying? I have a MXSegmentedPager embedded in a navigation controller (logging self.navgiationController outputs a NavigationController object) and it doesn't seem to show up (the nav bar).
I'm wondering if it'd be easy to add the ability to lazily load a page. For example, rather than allocating all views for each tab on creation, I'd probably want to only load the current one in view or the current one and the next one so that I don't keep them all in memory. Essentially having something more like UIPageViewController where the pages are reused or allocated/deallocated when shown / hidden would be ideal.
Any thoughts on how this might be accomplished?
Hi, I'm using MXSegmentedPager inside an UINavigationController. In iOS 8 it works great but in iOS 9 there's a blank offset of 64 at the top, which I think is 20 from the status bar and 44 from the navigation bar. The parallax header wouldn't scroll above that blank space but the segmented controller would.
I was able to fix this bug by adding this lines at the top of your function in MXParallaxHeader.m file:
- (void) setScrollViewContentTopInset:(CGFloat)top {
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"9.0")) {
top = self.height;
}
//rest of the code
}
You can set the parallax header and height. However, if you need to change the height of the header, there seems to be no way to do this.
Is there a way to insert a static (i.e. non parallax) view above the HMSegmentedControl - so the control does not appear at the top of the screen. For instance, if one wanted to put content above the control that shows regardless of selected segment.
Or is VGParallaxHeader the preferred approach to this - but 'turning off' the parallax effect?
Before update to v2.0 i used this method in MXSegmentedPager
Thanks.
I can't see any reference to a property supporting space between the page views within MXSegmentedPager and associated classes - apologies if I have missed it.
It would be nice to be able to support a 'gutter' between the page views like the UIPageView's UIPageViewControllerOptionInterPageSpacingKey option.
HMSegmentedControl supports the use of NSAttributedString as titles, however the MXSegmentedPager control blocks this as the MXSegmentedPagerDatasource protocol prescribes the use of NSString (which NSAttributedString does not subclass from) as part of its interface contract on the datasource method:
- (NSString*) segmentedPager:(MXSegmentedPager*)segmentedPager titleForSectionAtIndex:(NSInteger)index;
Hello, I'm trying to resize my tableView width by updating the frame of tableview but doesn't worked , I've tried to update tableview with at creation time, at viewWillAppear, tied to change cell Size at cellForRow... but none of them worked any help over here ?
Hi! @maxep
Thank you, open source is cool.
the selected item is highlighted.
not selected item is two color, blackColor at top and grayColor at bottom. look this picture
Nice work there. But, is it possible for me to disable the parallax. I don't want it. Thanks
I have a MXSegmentedPager with two lists and a parallax header.
I am implementing the method
- (void)segmentedPager:(MXSegmentedPager *)segmentedPager didSelectViewWithIndex:(NSInteger)index
to change the parallax header whenever the list changes (I change the imageView's image).
I animate the change of pictures for .5 seconds to make it a bit smoother. Whenever I transition from the first tab to the second, the animation is fine. However, on certain instances, when I change from tab two to tab one, the animation doesn't work.
I logged a message whenever the animation started and when it finished and it seemed that the animation was starting twice. I then put a log at the beginning of the method and confirmed that the method was indeed called twice when switching from the second tab to the first one.
I cannot find a way to keep the user from scrolling between the views using horizontal gestures. I want to allow the user to tap the segmentedControl to change views, but I do not want the control to recognize and respond to horizontal gestures. I use several tableviews and I need the swipe to delete functionality; the tableview currently doesn't recognize swipe to delete since this gesture currently will only scroll between the views. I am using MXSegmentedPager only. Tried to remove the gesture recognizer delegate (among other things) and it did not work.
VGParallaxHeader implements updateParallaxHeaderViewHeight, which is not exposed here.
Hi
I want to add a UIView
with a button for navigation at the bottom of UIViewController
extended from MXSegmentedPagerController
. I kept it in xib but that's not working.
When I use MXSegmentedPager for my detail controller in a uisplitviewcontroller, I encounter the following issue.
Pulling down the view past a certain point results in the enlarged image view 'sticking' at its enlarged size. When the view is released and the header returns to normal size, the imageview is still enlarged.
This is happening in the split view sample app we looked at in a previous issue.
If I want to add a pull to refresh function, how can I do that?
Or when the header had scrolled down to the bottom(without stretched), how can I just scroll down the tableview to pull to refresh. Thanks
It's hard to say if this is my code implementation or something in MXSegmentedPager that needs to remove obserever. I'm getting the followed error when removing a view that has a MXSegmentedPager.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x137577700 of class MXPagerView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x170c55e40> ( <NSKeyValueObservance 0x1702d4cf0: Observer: 0x137577700, Key path: contentOffset, Options: <New: YES, Old: YES, Prior: NO> Context: 0x100ab23f0, Property: 0x17084e4c0> <NSKeyValueObservance 0x1702d4b30: Observer: 0x137577700, Key path: contentSize, Options: <New: NO, Old: NO, Prior: NO> Context: 0x100ab23f0, Property: 0x170851fd0>
Hi, is there an easy way to use
- (UIView *)segmentedPager:(MXSegmentedPager *)segmentedPager viewForPageAtIndex:(NSInteger)index
to use View Controller Subviews that would be loaded only when the corresponding segment control is selected?
The goal would be to use view controllers' subviews where data is loaded.
Hi @maxep, you can reproduce this bug by adding this code in the MXSegmentedPager-Swift
sample:
override func numberOfPagesInSegmentedPager(segmentedPager: MXSegmentedPager) -> Int {
return 0
}
Thanks,
Luca
First of all Thanks for the awesome library......Is it possible to create view on storyboard and then add them to the tab...or do we have to write whole ui programmatically....
I want to display another view when the parallaxHeader has reached its minimum height. How do I catch the event of reaching the minimum height in MXSegmentedPager?
I am using iAd in my app. Sometimes, the screen frame increases and decreases momentarily as the iAd leaves and comes back on the screen. This causes a visible double-reload of the screen, which looks awful - the screen seems to jerk and flicker.
When I implement segmentedpager at a detail page and want to push pop the view it crashes some times at first pop and sometimes at second push. Here is the call stack.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x14480a600 of class MXScrollView was deallocated while key value observers were still registered with it. Current observation info: NSKeyValueObservationInfo 0x144704da0 (
NSKeyValueObservance 0x14468d180: Observer: 0x144588900, Key path: contentOffset, Options: New: YES, Old: NO, Prior: NO Context: 0x1001e00e8, Property: 0x144553890
NSKeyValueObservance 0x1446dc1b0: Observer: 0x144588900, Key path: contentInset, Options: New: YES, Old: YES, Prior: NO Context: 0x1001e00e8, Property: 0x1446bcc30
)'
*** First throw call stack:
(0x18475cf48 0x19930ff80 0x18475ce90 0x18561f640 0x199329ae8 0x184640a4c 0x184712068 0x184640ca0 0x18f87c088 0x189d58ffc 0x1000c3fe8 0x199b5e8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
I copied and pasted the code from MXParallaxViewController into a file (I called it SampleViewPager) in my project.
I then hooked it up to my REFrostedViewController (it is a drawer library I use which uses a panGestureRecognizer to slide the side menu in and out).
This causes it to crash at removeObserverFromView, specifically when it calls [view removeObserver: self forKeyPath:kContentOffsetKeyPath context:kMXScrollViewKVOContext];
It only crashes when the app loads and I try to scroll something within the tableview / webview / text view
Hi,
i'm trying to add your very nice library into my project but i've got an issue when i insert the mxsegmentedPager directly in the storyboard.
It seems the datasource and delegate need to be set at first place but the app failed before i can set them in my viewController.
Here is the error :
Could you help me with that ?
Thanks in advance
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.