Android Wear CircledImageView (and DelayedConfirmationView) Always Square

我与影子孤独终老i 提交于 2019-12-10 21:51:46

问题


Anytime I try to use a CircledImageView (I'm developing on an LG G Watch) my image has a squared background. I get the same result with a DelayedConfirmationView, plus there is no "countdown animation."


回答1:


Turns out the issue with the rounding was that I was specifying the layout_width and layout_height in dp instead of using wrap_content.

The issue with the "countdown" animation is that there needs to be a border width and color specified.

EDIT: Here's a sample of what I was using (app is defined under the xmlns:android as xmlns:app="http://schemas.android.com/apk/res-auto") :

<android.support.wearable.view.CircledImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_action_call"
    app:circle_color="@color/green"
    app:circle_radius="30dp"
    app:circle_radius_pressed="40dp"/>

In terms of the attributes, I use Intellij/AS which auto-completes them. If you're not using either of those IDEs, the attributes pretty much correspond to the method names, so you can match them from there.



来源:https://stackoverflow.com/questions/24666288/android-wear-circledimageview-and-delayedconfirmationview-always-square

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!