Android: Heart Shaped small button to add item to favorite -


i have found answer question how create heart shaped button using vector xml.

answer here: https://stackoverflow.com/a/45618554/8523262

but not able correctly implemented in case.

i have 2 buttons side side third heart-button. however, not fit correctly other 2 buttons. need smaller original answer has it.

here xml

    <linearlayout     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:orientation="horizontal"     android:padding="7sp"     android:textsize="12sp"     >      <button         android:id="@+id/buttonia"         android:layout_width="0sp"         android:layout_weight=".3"         android:layout_height="25sp"         android:background="@drawable/buttondesign"         android:textcolor="@color/white"         android:text="hide arabic version"         />      <button         android:id="@+id/buttonir"         android:layout_width="0sp"         android:layout_weight=".3"         android:layout_height="25sp"         android:background="@drawable/buttondesign"         android:textcolor="@color/white"         android:layout_marginstart="7sp"         android:text="hide reference"         />     <button         android:id="@+id/buttonf"         android:layout_width="0sp"         android:layout_weight="0.3"         android:layout_height="25sp"         android:background="@drawable/buttondesign"         android:textcolor="@color/white"         android:layout_marginstart="7sp"         android:text="favorite it!"         /> </linearlayout> 

can please tell me resize heart when placed inline 2 buttons have already.

buttonf tried set vector background of. changed height/width didn't how need it.

thank you.

i use imagebutton button instead of button now. use imageview too. favoritebutton in below code vector xml shared link of in questions, in case helps anyone.

        <imagebutton         android:id="@+id/buttonf"         android:layout_weight=".3"         android:layout_width="24dp"         android:layout_height="24dp"         android:src="@drawable/favoritebutton"         android:textcolor="@color/white"         android:layout_marginstart="7dp"         android:background="@null"      /> 

Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -