zoukankan      html  css  js  c++  java
  • 一手遮天 Android

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

    一手遮天 Android - view(进度类): RatingBar 样式

    示例如下:

    /view/progress/RatingBarDemo2.java

    /**
     * RatingBar - 评分条
     */
    
    package com.webabcd.androiddemo.view.progress;
    
    import androidx.appcompat.app.AppCompatActivity;
    import android.os.Bundle;
    
    import com.webabcd.androiddemo.R;
    
    public class RatingBarDemo2 extends AppCompatActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_view_progress_ratingbardemo2);
        }
    }
    
    

    /layout/activity_view_progress_ratingbardemo2.xml

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <!--
            RatingBar - 评分条
        -->
    
        <!--
            通过 style 自定义 RatingBar 的样式(参见 values/styles.xml 中的“MyRatingBarStyle”)
        -->
        <RatingBar
            android:id="@+id/ratingBar1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            style="@style/MyRatingBarStyle"/>
    
        <!--
            通过 progressDrawable 自定义 RatingBar 的样式(参见 drawable/layerlist_ratingbar_progress)
            通过 minHeight, maxHeight 来指定 RatingBar 的高度
        -->
        <RatingBar
            android:id="@+id/ratingBar2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:numStars="5"
            android:stepSize="0.5"
            android:rating="3"
            android:minHeight="40dp"
            android:maxHeight="40dp"
            android:progressDrawable="@drawable/layerlist_ratingbar_progress"/>
    
    </LinearLayout>
    
    

    项目地址 https://github.com/webabcd/AndroidDemo
    作者 webabcd

  • 相关阅读:
    Core上传图片
    Pytho学习(3)——注释
    zabbix实操随笔
    1900型USB接口扫描枪设置虚拟串口模式提升扫描速度
    SQLServer设置单用户
    入门安装环境
    centos下载
    java学习资料
    错误模块名称: KERNELBASE.dll
    iis部署WebService出现"因 URL 意外地以 结束,请求格式无法识别"的解决方法
  • 原文地址:https://www.cnblogs.com/webabcd/p/android_view_progress_RatingBarDemo2.html
Copyright © 2011-2022 走看看