【问题标题】:<com.chaos.view.PinView this is show nothing for me<com.chaos.view.PinView 这对我来说什么也没显示
【发布时间】:2021-02-06 05:00:53
【问题描述】:

实现 'com.chaos.view:pinview:1.4.4' 当我尝试在我的布局上调用它时 它什么也没显示

 <com.chaos.view.PinView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"/>

这是我的布局代码

我已经尝试过 1.4.2 , 1.4.3 版本,还是一样,显示下划线

我已经尝试使用另一个 pinview,比如 otpview,但仍然显示下划线

its show like this

and this is my dependencies

This is what i want to make

【问题讨论】:

    标签: java android gradle android-gradle-plugin gradle-plugin


    【解决方案1】:

    您没有看到任何块的原因是您没有添加项目计数,它定义了您的 pin-view 包含的值的数量。下面是可以帮助您在应用程序中正确查看 pin-view 的代码。

    <com.chaos.view.PinView
        android:id="@+id/firstPinView"
        style="@style/PinWidget.PinView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:cursorVisible="true"
        android:hint="Hint."
        android:inputType="text"
        android:itemBackground="@mipmap/ic_launcher"
        android:padding="@dimen/common_padding"
        android:textColor="@color/text_colors"
        android:textSize="18sp"
        android:textStyle="bold"
        app:cursorColor="@color/line_selected"
        app:cursorWidth="2dp"
        app:hideLineWhenFilled="true"
        app:itemCount="5"    //The required line
        app:itemHeight="48dp"
        app:itemRadius="4dp"
        app:itemSpacing="0dp"
        app:itemWidth="48dp"
        app:lineColor="@color/line_colors"
        app:lineWidth="2dp"
        app:viewType="rectangle" />
    

    PS:如果您在 android studio 中看不到 pin 项目,但可以在应用中看到它,则再次构建 Gradle,您可以在 studio 中看到 pin 块

    【讨论】:

    • 已经全部搞定了,还是不行,我已经尝试删除 .androidstudio 文件检查设置是否出错
    • 我已经尝试使用 1.4.2、1.4.3 和 1.4.4 即使我输入 itemcount @CodeREDInnovations 仍然没有出现
    • 你在模拟器或实时设备上试过了吗?您的设备中也没有出现这些块吗?
    【解决方案2】:

    我可能回复晚了一点,但我遇到了同样的问题。

    在我按照以下步骤重建项目后,它对我有用:

    Build -> Make Project

    默认的快捷方式是:

    Ctrl+F9

    【讨论】:

      猜你喜欢
      • 2014-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-07
      • 2012-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多