Author Topic: ScrollView - Soft clip at bottom only?  (Read 7897 times)

aholla

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 40
    • View Profile
ScrollView - Soft clip at bottom only?
« on: June 26, 2014, 07:10:50 AM »
Hi does anyone know how I could created a vertical scrollview which fades out at the bottom only?

Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView - Soft clip at bottom only?
« Reply #1 on: June 26, 2014, 11:22:01 AM »
Use 2 overlapping scroll views. Upper one soft clipped, lower one hard clipped (border 0).

aholla

  • Newbie
  • *
  • Thank You
  • -Given: 4
  • -Receive: 0
  • Posts: 40
    • View Profile
Re: ScrollView - Soft clip at bottom only?
« Reply #2 on: July 31, 2014, 03:44:37 AM »
Hi I don't understand how the two scroll views would work.

I want to scroll a large UILabel full of text. I want the top the be hard clipped (you can see the text getting cut off) but I would like the bottom text to be faded so the bottom of the view is transparent leaving only a certain amount visible at the top to the middle.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView - Soft clip at bottom only?
« Reply #3 on: July 31, 2014, 11:19:00 AM »
As I said, two scroll views. Imagine two boxes, one depicted using "@" and another using "+":
  1. @@@@@@@
  2. @     @
  3. #+++++#
  4. #.....#
  5. #.....#
  6. #.....#
  7. #.....#
  8. #@@@@@#
  9. +     +
  10. +++++++
  11.  
The "#" is where both of them overlap. The dots are where your content will be.

jeldrez

  • Sr. Member
  • ****
  • Thank You
  • -Given: 8
  • -Receive: 4
  • Posts: 352
    • View Profile
Re: ScrollView - Soft clip at bottom only?
« Reply #4 on: July 31, 2014, 03:07:01 PM »
Shouldn't be easier to have softness X Left/Right and Y Top/Bottom in the same clipping panel options?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ScrollView - Soft clip at bottom only?
« Reply #5 on: August 01, 2014, 07:12:28 PM »
Sure, but doing so will complicate the shader quite a bit, resulting in reduced performance for everyone else. This kind of edge case is not worth downgrading everyone's performance.