任何人都可以帮助我绘制径向搜索条

时间:2017-06-05 10:55:51

标签: android

Radial SeekBar

请帮我画一个Radial SeekBar,Plaese检查图片网址,这是搜索栏的实际设计。我尝试了很多方法,但没有正确解决。

我试过这个

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
tools:context="com.scanner.com.protracterview.MainActivity">

<TextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="0"
    android:id="@+id/number"
    android:textSize="18sp"
    android:layout_marginBottom="30dp"
    android:gravity="center"/>

<com.goodiebag.protractorview.ProtractorView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:arcColor="#91d8f7"
    app:arcProgressColor="#91d8f7"
    app:tickColor="#4a4a4a"
    app:indicatorType="line"
    app:tickProgressColor="#abe6"
    app:textColor="#000"
    app:textProgressColor="#FF0000"
    app:angleTextSize="0dp"
    app:arcWidth="2dp"
    app:progressWidth="2dp"
    app:tickOffset="18dp"
    app:tickLength="0dp"
    app:angle="15"
    android:id="@+id/protrat"
    app:tickIntervals="15"
    app:ticksBetweenLabel="three"
    app:touchInside="true"
    app:roundEdges="true"
    android:layout_below="@+id/number"
    android:layout_alignParentEnd="true" />

1 个答案:

答案 0 :(得分:1)

enter image description here

如果你想要这样的东西 - 关注this - (Matt Joseph

  1. 您的项目中有一个 CircularSeekBar.java 类将其粘贴
  2. attrs.xml(在res / values / attrs.xml中)
  3. 并且您的xml文件应该是这样的,

    <mrbrown.arcseekbar.CircularSeekBar
        android:id="@+id/circularSeekBar1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:start_angle="180"
        app:end_angle="0"
        app:circle_x_radius="500dp"
        app:circle_y_radius="500dp"
        app:use_custom_radii="true"
        app:progress="0"
        app:max="100"
        app:pointer_alpha_ontouch="100"
        app:pointer_color="#0174DF"
        app:pointer_halo_color="#880174DF"/>