Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UITextField scrolls under the section view #43

Closed
osrl opened this issue Apr 7, 2014 · 9 comments
Closed

UITextField scrolls under the section view #43

osrl opened this issue Apr 7, 2014 · 9 comments

Comments

@osrl
Copy link

osrl commented Apr 7, 2014

I've used viewForHeaderInSection delegate method and put a section header on the tableViews in your demo app. TextFields scrolls under the sectionView.

@hackiftekhar
Copy link
Owner

Could you provide me a demo app?

@osrl
Copy link
Author

osrl commented Apr 8, 2014

Just paste these lines to the 'ScrollViewController' and switch bottom left scrollView and tableView in the main stroyboard



- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    NSString *headerText = @"title";

    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, [UIScreen mainScreen].bounds.size.width, 40)];
    headerView.backgroundColor = [UIColor colorWithWhite:0.953 alpha:1.000];

    UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectInset(headerView.bounds, 12.0f, 5.0f)];
    textLabel.text = headerText;
    textLabel.font = [UIFont fontWithName:@"Helvetica" size:([UIFont systemFontSize] + 1.0f)];
    textLabel.textColor = [UIColor redColor];
    textLabel.backgroundColor = [UIColor clearColor];
    textLabel.textAlignment = NSTextAlignmentCenter;
    [headerView addSubview:textLabel];

    UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(0.0f, headerView.bounds.size.height, [UIScreen mainScreen].bounds.size.width, 1.0f)];
    bottomLine.backgroundColor = [UIColor colorWithWhite:0.890 alpha:1.000];
    [headerView addSubview:bottomLine];
    return headerView;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 40;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

@hackiftekhar
Copy link
Owner

It's not a bug, It's the default nature of UITableView.

@osrl
Copy link
Author

osrl commented Apr 18, 2014

Of course it's nature of UITableView, but i think table view should move up as section height so text field is visible, not under the section

@hackiftekhar
Copy link
Owner

But it breaks the default rule of UITableView, and it would a bad thing for such universal libraries.

@osrl
Copy link
Author

osrl commented Apr 20, 2014

I think you get me wrong :) of course it should behave like that when
scrolling. But when writing to the uitextfield it should be visible, not
under the section am I right?
18 Nis 2014 17:59 tarihinde "Mohd Iftekhar Qurashi" <
notifications@github.com> yazdı:

But it breaks the default rule of UITableView, and it would a bad thing
for such universal libraries.


Reply to this email directly or view it on GitHub.

@hackiftekhar
Copy link
Owner

Yes.

@osrl
Copy link
Author

osrl commented Apr 20, 2014

Well it is under under the section view when writing to it :) it's still your call though ;)

@hackiftekhar
Copy link
Owner

Please suggest me how should I proceed technically?

On Mon, Apr 21, 2014 at 12:44 AM, Osman Saral notifications@github.comwrote:

Well it is under under the section view when writing to it :) it's still
your call though ;)


Reply to this email directly or view it on GitHubhttps://github.com//issues/43#issuecomment-40902407
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants