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

Icon + Text not centered? #47

Closed
xsorifc28 opened this issue Jul 9, 2015 · 2 comments
Closed

Icon + Text not centered? #47

xsorifc28 opened this issue Jul 9, 2015 · 2 comments
Assignees
Labels

Comments

@xsorifc28
Copy link

I have the following:

<com.mikepenz.iconics.view.IconicsButton
    android:id="@+id/facebookLogin"
    android:theme="@style/Button_Facebook"
    android:text="{faw-facebook} Log in with Facebook"
    android:textAllCaps="false"
    android:layout_below="@+id/textView2"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="16dp"
    android:layout_width="wrap_content"
    android:layout_height="56dp"
    android:textColor="@android:color/white"
    android:textSize="20sp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp">
</com.mikepenz.iconics.view.IconicsButton>

The icon doesn't seem to be centered with the text. Is this something wrong with my implementation or a bug? The padding also doesn't seem to apply. Any help is appreciated!

@mikepenz
Copy link
Owner

mikepenz commented Jul 9, 2015

@xsorifc28 vertical centering within the text is not possible, as the icon interacts as a normal text within this sample. If you want it in front of the text you should go with a CompoundDrawable and set it via code.

@mikepenz mikepenz self-assigned this Jul 9, 2015
@mikepenz mikepenz closed this as completed Jul 9, 2015
@tmm1
Copy link

tmm1 commented Jun 13, 2018

If you want it in front of the text you should go with a CompoundDrawable and set it via code.

When using drawableLeft with an IconicDrawable, the icon appears left-aligned. Is there any way to make it centered horizontally along with the text so it looks similar to how the spannable version does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants