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

Question - How can I apply a layout margin in a stack component #332

Closed
avnerbarr opened this issue Aug 2, 2015 · 4 comments
Closed

Question - How can I apply a layout margin in a stack component #332

avnerbarr opened this issue Aug 2, 2015 · 4 comments

Comments

@avnerbarr
Copy link
Contributor

I'm trying to accomplish "stretch" for a component and add a layout margin with right alignment. (comparable to android linear layout)

In android it could be accomplished by

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_gravity="center_horizontal"
        >
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:textStyle="bold"
            android:fontFamily="sans-serif-light"
            android:text="1234567"
            android:padding="0dp"
            android:textColor="@android:color/black"
            android:background="#ff0000"
            android:gravity="right"
            />
    </LinearLayout>

I've tried various combinations but I find that the stack layout alignSelf only applies to the outer component so I am not able to align the correct component to the right.

Any ideas how I could accomplish this?

@smiLLe
Copy link

smiLLe commented Aug 3, 2015

Do you want to align your component to the right, then this might help.
#62

{
[CKComponent new],
.flexGrow = YES,
},

@avnerbarr
Copy link
Contributor Author

Actually something that could vertically align a child in a vertical layout (for instance align one child at the bottom in a vertical layout while the other is aligned top)

@grp
Copy link
Contributor

grp commented Aug 3, 2015

I think the reference @smiLLe posted should work, since it's the same idea just in the vertical dimension vs horizontal?

@adamjernst
Copy link
Contributor

Reopen if it doesn't work.

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

No branches or pull requests

4 participants