这部分对我来说没有显示出任何内容。

huangapple go评论79阅读模式
英文:

<com.chaos.view.PinView this is show nothing for me

问题

实现部分:

implementation '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,但仍然显示一个下划线条。

显示效果如下

这是我的依赖项

这是我想要实现的效果

英文:

implementation 'com.chaos.view:pinview:1.4.4'
when i try to call it on my layout
it show nothing

 &lt;com.chaos.view.PinView
            android:layout_width=&quot;wrap_content&quot;
            android:layout_height=&quot;wrap_content&quot;/&gt;

this is my layout code

i already try 1.4.2 , 1.4.3 version and still the same, its show a underline strip

and i already try using another pinview like otpview, and still show a underline strip

its show like this

and this is my dependencies

This is what i want to make

答案1

得分: 3

在我的情况下,我通过替换它来解决了这个问题。

你应该将这个实现替换为:

implementation 'io.github.chaosleung:pinview:1.4.4'
英文:

In my case I solved this issue by replaced it.

you should replace this implementation:

implementation &#39;com.chaos.view:pinview:1.4.4&#39;

to this implementation :

implementation &#39;io.github.chaosleung:pinview:1.4.4&#39;

答案2

得分: 1

我也曾面临同样的问题,但当我将依赖项实现在顶部时,它对我起作用了。。

你可以尝试这样做。

<com.chaos.view.PinView>这部分对我来说没有显示出任何内容。

你可以尝试这样做。

英文:

I was also facing the same problem but as soon as I implemented the dependency at the top it worked for me..

<com.chaos.view.PinView>这部分对我来说没有显示出任何内容。

You can try to do so.

答案3

得分: 0

以下是代码的翻译部分:

<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="提示。"
    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"    //所需行
    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 区块。

英文:

The reason you aren't seeing any blocks is you haven't added the item count which defines the number of values you pin-view contains. Below is the code that can help you view the pin-view properly in your application.

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

PS: If you can't see the pin item in your android studio but you can see it in the app then build the Gradle again and you can see the pin blocks in your studio

答案4

得分: 0

抱歉可能回复有点晚,但我遇到了相同的问题。

按照以下步骤重新构建我的项目后,它对我起作用了:

Build -> Make Project

默认情况下的快捷键是:

Ctrl+F9

英文:

I might be a little late to reply, but I was facing the same issue.

It worked for me after I rebuilt my project following these steps:

Build -> Make Project

Shortcut for that would be by default:

Ctrl+F9

huangapple
  • 本文由 发表于 2020年10月23日 14:09:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/64494754.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定