gpt4 book ai didi

android - 如何更改 drawableLeft 图标的大小?

转载 作者:行者123 更新时间:2023-11-29 16:57:06 26 4
gpt4 key购买 nike

<分区>

我已经在寻找一些解决方案 how to change a drawableLeft icon size on a button? ,但这对我不起作用。

我的按钮布局:

<RelativeLayout
android:id="@+id/twoButtonLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#eceef5"
android:visibility="visible">

<Button
android:id="@+id/goToPersonalPage"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_marginLeft="31dp"
android:drawableLeft="@drawable/drawable_left_green"
android:paddingLeft="18dp"
android:drawablePadding="-10dp"
android:background="@drawable/button_oval"
android:text="ICon"
android:textColor="#29395e"
android:textSize="18dp" />

<Button
android:id="@+id/logOutPersonal"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_marginRight="30dp"
android:background="@drawable/button_oval"
android:text="@string/logOut"
android:textColor="#29395e"
android:textSize="18dp" />

</RelativeLayout>

我通过drawable_left_green.xml调整按钮的大小:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
// I think it should be more smaller if i set 15sp.
<item
android:drawable="@mipmap/ic_launcher"
android:width="15sp"
android:height="15sp"
/>

</layer-list >

当我编译项目时,它 (photo2) 看起来不像预览布局 (photo1): enter image description here enter image description here

我不明白为什么会这样,有人可以教我如何解决吗?任何帮助将不胜感激,提前致谢。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com