Welcome,
Guest
. Please
login
or
register
.
July 18, 2025, 08:57:55 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set scrollview to specific width
« previous
next »
Print
Pages: [
1
]
Author
Topic: Set scrollview to specific width (Read 2799 times)
kalledemos
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
Set scrollview to specific width
«
on:
February 06, 2014, 10:21:41 PM »
Is there a way to set a scroll view to be a specific width? I need it to fill a portion of the bottom of the screen regardless of the aspect ratio.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Set scrollview to specific width
«
Reply #1 on:
February 06, 2014, 10:37:10 PM »
Anchor the scroll view's panel, or just set its UIPanel.baseClipRegion
Logged
kalledemos
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
Re: Set scrollview to specific width
«
Reply #2 on:
February 07, 2014, 11:46:37 AM »
Anchoring it seems to work at the start, but when I try to move it at runtime its contents get off centered.
Logged
kalledemos
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
Re: Set scrollview to specific width
«
Reply #3 on:
February 07, 2014, 12:44:06 PM »
Ok I just used UIStretch. It seems to work pretty well with UIAnchor to keep it at relative position and width.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Set scrollview to specific width
«
Reply #4 on:
February 08, 2014, 03:01:35 PM »
Don't use UIAnchor and UIStretch. All panels and widgets have "Anchors" section that you can use instead.
Unless you're on an older version of NGUI.
Logged
kalledemos
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 5
Re: Set scrollview to specific width
«
Reply #5 on:
February 09, 2014, 01:18:29 PM »
Do those anchors only run once at initialization, allowing them to be freely moved afterwards?
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Set scrollview to specific width
«
Reply #6 on:
February 09, 2014, 04:47:07 PM »
New anchoring system is persistent. If something is anchored, you can't move it unless you remove the anchor. However tweens still work as expected even if the object is anchored.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Set scrollview to specific width