2

Here is my current code.

<Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Weather"
        android:textColor="@color/colorDark"
        style="@style/XM.ActionBar.ButtonSecondary"
        android:drawableTop="@mipmap/ic_weather_sunny" />

How do I make the entire button smaller in size? It is in a LinearLayout.

Thanks Kevin

user0918j9
  • 23
  • 1
  • 4

3 Answers3

3

You can set the width and height manually instead of using wrap_content if you want smaller button size. But doing so would probably make your button too small to contain the text inside. So you probably would like to control the font size

<Button android:layout_width="100dp"
    android:layout_height="100dp"
    android:text="Weather"
    android:textSize="10sp"
    android:textColor="@color/colorDark"
    style="@style/XM.ActionBar.ButtonSecondary"
    android:drawableTop="@mipmap/ic_weather_sunny"/>

Edited: textSize to sp thanks @MinnuKaAnae

Andy
  • 449
  • 5
  • 13
0

Change width and height to as per your requirement

  <Button
    android:layout_width="80dp"
    android:layout_height="40dp"
    android:text="Weather"
    android:textColor="@color/colorDark"
    style="@style/XM.ActionBar.ButtonSecondary"
    android:drawableTop="@mipmap/ic_weather_sunny" />
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
MinnuKaAnae
  • 1,646
  • 3
  • 23
  • 35
  • 1
    Not working in the sense I want the entire button to be scaled down, not just the absolute size. Meaning I want the entire drawable + text size + clickable space to be smaller. http://imgur.com/a/UxEmC – user0918j9 Jul 11 '17 at 13:52
0

Try setting width and heigth to somthing like 40dp each. If it does not work, remove the theme applied :D