Android Wear CircledImageView(和DelayedConfirmationView)始终广场 [英] Android Wear CircledImageView (and DelayedConfirmationView) Always Square

查看:539
本文介绍了Android Wear CircledImageView(和DelayedConfirmationView)始终广场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试使用 CircledImageView (我开发上的LG G Watch)的我的形象有一个平方的背景。我得到同样的结果 DelayedConfirmationView ,再加上没有倒计时动画。

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."

推荐答案

原来用四舍五入的问题是,我被指定 layout_width layout_height DP 而不是使用 WRAP_CONTENT

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.

编辑:这是我用什么样的样品(应用的xmlns定义:机器人的xmlns:程序=htt​​p://schemas.android.com/apk/res-auto

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"/>

在属性方面,我使用的IntelliJ /作为自动完成它们。如果你没有使用其中任何一个IDE中,属性pretty多对应的方法名,所以你可以从那里匹配。

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.

这篇关于Android Wear CircledImageView(和DelayedConfirmationView)始终广场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆