Giter Club home page Giter Club logo

Comments (4)

asmallteapot avatar asmallteapot commented on August 29, 2024

Yes. After creating the pullToRefreshView, do something like this:

parentView.pullToRefreshView.backgroundColor = [UIColor greenColor];

from svpulltorefresh.

x2on avatar x2on commented on August 29, 2024

But that backgroundcolor is only a the pullToRefreshView. If you pull the scroll view down, the part above this view is white.

If you set the backgroundColor to the scrollview, everything is colored (also the table...)

Any ideas?

from svpulltorefresh.

asmallteapot avatar asmallteapot commented on August 29, 2024

The white area you’re seeing above the pullToRefreshView is actually part of the table view’s scroller. To get the effect you’re after, you’ll have to set the color of both the pullToRefreshView and tableView, then set the background color of the cells using this method:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
    cell.backgroundColor = [UIColor whiteColor];
}

An important caveat about this technique: Your table view’s background colour will be displayed in any empty space below the cells your data source provides, even if its display style is set to plain. See the attached screenshot:

Table view background color applies to any empty space, including those below your cells

I’m not sure how to address that issue, but this Stack Overflow thread provides a lot of solid information about customizing table view colours.

from svpulltorefresh.

samvermette avatar samvermette commented on August 29, 2024

@asmallteapot is right, the color above the pull to refresh view belongs to the table view. If you want to change that portion of the table view's background color only (and not the bottom part), you're gonna have to add a new view/layer above the pull to refresh view and set its backgroundColor. That's how I've been doing it in most of my apps anyway.

from svpulltorefresh.

Related Issues (20)

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.