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

feat(android): adjust left padding for ScrollableView #13873

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented Jun 27, 2023

Adds leftAdjust (int) to the ScrollableView padding settings. With this you can move the first item to the left corner again but still show the next item.

Update
I've changed the parameter to be leftAdjust and you can set a custom number. If you use -left it will be back to 0 but you can set any value now

var win = Ti.UI.createWindow();

var view1 = Ti.UI.createView({ borderRadius: 20, backgroundColor:'#123' });
var view2 = Ti.UI.createView({ borderRadius: 20, backgroundColor:'#246' });
var view3 = Ti.UI.createView({ borderRadius: 20, backgroundColor:'#48b' });

var scrollableView = Ti.UI.createScrollableView({
  views:[view1,view2,view3],
	height: 300,
	clipViews: false,
  padding: {
		left: 100,
		leftAdjust: -100,	// <------- new value
		right: 100,
	}
});

win.add(scrollableView);
win.open();
simplescreenrecorder-2023-06-27_23.02.34.mp4

Todo:

  • Docs
  • Possible on iOS?

@m1ga m1ga changed the title feat(android): adjustPadding for ScrollableView padding feat(android): adjust left padding for ScrollableView Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant