Android Layout button behaviour -


i have main activity:

<relativelayout  xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/main_back" tools:context="com.project.mainactivity" >  <button     android:id="@+id/buttonplay"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_marginright="20dp"     android:layout_marginend="20dp"     android:layout_margintop="100dp"     android:background="@drawable/btn_play_back"     android:onclick="goplay"     android:layout_alignparenttop="true"     android:layout_alignparentright="true"     android:layout_alignparentend="true" />  </relativelayout> 

in drawable folder have btn_play_back.png 360 x 126. when check size of button programatically doing btn.getwidth() returns 315 , not 360. height it's ok returns 126.

i want return 360 , not 315. why happening?


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -