ScrollableView - manually position the PagingControl
Hey there!
It would be great if we could position the PagingControl freely within the ScrollableView.
What I am trying to do is putting the paging control INSIDE the ScrollableView because at the moment I have placed the ScrollableView at the very bottom of the screen and you can barely see those dots.
2 Answers
-
Hi, this function isn't implemented in Titanium, but you can easy fix that.
I used a transparent paging in my project to see the dots over my images.
To make this:
Open /Library/Application Support/Titanium/mobilesdk/osx/1.x.x/iphone/Classes/TiUIScrollableView.m (where 1.x.x is your version of sdk, like 1.4.2, 1.4.3 or 1.5.0)
find this line in this file:
viewBounds.size.height = visibleBounds.size.height - (showPageControl ? pageControlHeight : 0);
and change to this:
viewBounds.size.height = visibleBounds.size.height; // - (showPageControl ? pageControlHeight : 0);
now, find this:
contentBounds.size.height = viewBounds.size.height-(showPageControl ? pageControlHeight : 0);
and change to this:
contentBounds.size.height = viewBounds.size.height; //-(showPageControl ? pageControlHeight : 0);
for optional i put in my code a option to contro the opacity of this bar:
find this:
-(void)setPagingControlColor_:(id)args { [[self pagecontrol] setBackgroundColor:[[TiUtils colorValue:args] _color]]; }
and paste this code before:
-(void)setPagingControlOpacity_:(id)opacity { [[self pagecontrol] setAlpha:[TiUtils floatValue:opacity]]; }
Save, and make a full compile of your project.
now to use:
yourScrollable.pagingControlColor = 'YourColor'; yourScrollable.pagingControlOpacity = YourOpacity;
YourColor can be in these formats: 'transparent', 'black' or '#ff00ff'
and YourOpacity can be: 0 (transparent) to 1 (opaque) or like this: 0.75 (75% of opacity) -
bump
Another question: 'pagingControlColor' controls the background color of the pagingControl.
Can we change the color of the dots?