Tag: 圈子

android.support.v4.widget.CircleImageView不起作用

当我尝试使用:android.support.v4.widget.CircleImageView <android.support.v4.widget.CircleImageView android:id="@+id/picture" android:layout_width="100dp" android:layout_height="100dp" android:layout_gravity="center_vertical" android:src="@drawable/ic_bg" /> 它使我的应用程序崩溃 如何支持新的Material Design Widget CircleImageView 有没有任何例子使用这个新的部件 logcat的 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vogella.android.recyclerview/com.vogella.android.recyclerview.MainActivity}: android.view.InflateException: Binary XML file line #9: Error inflating class android.support.v4.widget.CircleImageView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2255) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2309) at android.app.ActivityThread.access$700(ActivityThread.java:157) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1289) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:176) at android.app.ActivityThread.main(ActivityThread.java:5317) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) at […]

与边界的透明圈子

我想在android中使用XML创build一个只有边框的圆: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <stroke android:width="1dp" android:color="#000000"/> </shape> 我使用的代码已在上面发布。 但是,我得到一个坚实的磁盘和一个不响。 我想获得输出只使用XML而不是canvas。 我究竟做错了什么? 谢谢。 编辑:得到它的工作感谢下面的答案。 下面是我的最终代码: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:innerRadius="0dp" android:shape="ring" android:thicknessRatio="1.9" android:useLevel="false" > <solid android:color="@android:color/transparent" /> <size android:width="100dp" android:height="100dp"/> <stroke android:width="1dp" android:color="#FFFFFF"/> </shape>

在加载内容时使用ImageView中的“animation圈”

我目前在我的应用程序中使用一个列表视图,需要一秒钟才能显示。 我目前所做的是使用列表视图的@ id / android:empty属性来创build一个“加载”文本。 <TextView android:id="@id/android:empty" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF0000" android:text="Loading…"/> 现在,我想用在加载对话框中使用的animation圆而不是这个文本replace它,我想你们都知道我的意思: 编辑:我不想要一个对话框。 我想显示在我的布局。 非常感谢您的帮助!

animation绘制一个圆圈

我正在寻找一种方法来创build一个圆圈的绘图animation。 我已经能够创造出这个圈子,但它一起吸引了所有人。 这是我的CircleView类: import UIKit class CircleView: UIView { override init(frame: CGRect) { super.init(frame: frame) self.backgroundColor = UIColor.clearColor() } required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } override func drawRect(rect: CGRect) { // Get the Graphics Context var context = UIGraphicsGetCurrentContext(); // Set the circle outerline-width CGContextSetLineWidth(context, 5.0); // Set the circle […]