首页 > 解决方案 > 为什么我的 ElegantNumberButton 没有显示 +(加号) 符号?

问题描述

我的xml代码

<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
                        android:id="@+id/number_button"
                        android:layout_width="100dp"
                        android:layout_height="30dp"
                        android:layout_marginBottom="18dp"
                        android:layout_marginLeft="8dp"
                        android:layout_marginTop="8dp"
                        app:backGroundColor="@color/colorAccent"
                        app:finalNumber="20"
                        app:initialNumber="1"
                        app:textSize="8sp"/>

我正在使用 ElegantNumberButton 那个版本:

implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'

有任何版本问题吗?

标签: androidandroid-layout

解决方案


我像@Matpag 说的那样解决了它

<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
      android:id="@+id/number_button"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginBottom="18dp"
      android:layout_marginLeft="8dp"
      android:layout_marginTop="8dp"
      app:backGroundColor="@color/colorAccent"
      app:finalNumber="20"
      app:initialNumber="1"
      app:textSize="8sp"/>

你不能改变android:layout_width&android:layout_height


推荐阅读