I have a Button with its width as match_parent
. And I want a image/icon with a text in its center. I have triedandroid:drawableStart
attribute but its of no help. I don't know what I am missing. Is there any one who is also facing the same problem.
Note:This link is not solving my problem. I am attaching my button portion of xml
<Button
android:background="@drawable/blue_button"
android:id="@+id/btn_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:drawableStart="@drawable/ic_list"
android:text="@string/btn_schedule"
android:textColor="@android:color/white" />
After adding these attribute my text is coming on center but image/icon is still on left side of button. Can any body help!!!