android-iconify icon indicating copy to clipboard operation
android-iconify copied to clipboard

Vertically center text + icon on IconButton

Open matthewkrueger opened this issue 7 years ago • 0 comments

Hi there - I have an IconButton with an Icon on the left, and text on the right. The problem is that, even with gravity=center_vertical, the text and icon in the button don't align vertically to each other. Is there a trick to do this? I saw the "baseline" attribute you can add inside the {} but since the text and icon are different font sizes, this doesn't work.

    <com.joanzapata.iconify.widget.IconButton
        android:id="@+id/fairway"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:gravity="center_vertical"
        android:textSize="16sp"
        android:text="{fa-icon-name 24sp} Fairway"/>

androidiconify-verticalalignment

matthewkrueger avatar Feb 03 '17 17:02 matthewkrueger