简体   繁体   English

迁移到androidx后,DrawableTop没有显示

[英]DrawableTop not showing after migrating to androidx

I have a button with text and icon drawable positioned at the top but after migrating to androidx the icon doesn't show on the text does. 我有一个按钮,文本和图标可绘制位于顶部,但在迁移到androidx后,图标不显示在文本上。

<Button
  android:id="@+id/activity_advanced_seats_btn_reserved_key"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:layout_gravity="center"
  android:drawableTop="@drawable/icon_seat_reserved_key"
  android:layout_margin="10dp"
  android:background="@android:color/transparent"
  android:text="Reserved"
  android:textColor="@android:color/white"
  android:textAllCaps="false"
  android:textStyle="bold"
  android:textSize="12sp"
  android:gravity="center_horizontal"
  android:enabled="false" />

事实证明它确实有效但我看不到图像,在图标最终显示之前必须删除按钮上的默认色调:

app:iconTint="@null"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM