Giter VIP home page Giter VIP logo

viewusage's Introduction

ViewUsage

用于总结一些View的方便用法

1、一个带有图标和文字的控件

用一个TextView即可搞定

<TextView
      android:layout_width=""wrap_content""
      android:layout_height=""63dip""
      android:layout_centerHorizontal=""true""
      android:layout_gravity=""center""
      android:drawablePadding=""1dp""
      android:drawableTop=""@drawable/i_comimit""
      android:gravity=""center_horizontal""
      android:paddingBottom=""3dp""
      android:paddingTop=""3dp""
      android:text=""发布""
      android:textColor=""@color/txt_normal""
      android:textSize=""11dip"" />

2、一个旋转图标,例如加载中的提示git图

可以用 ProgressBar 控件

     <ProgressBar
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_marginTop="0dp"
        android:id="@+id/progress1"
        android:indeterminateDrawable="@drawable/progress_gear_fu"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

我们看看progress_gear_fu文件怎么写的

<?xml version="1.0" encoding="utf-8"?>   
<rotate xmlns:android="http://schemas.android.com/apk/res/android"  
    android:drawable="@drawable/i_loading"
    android:pivotX="50%"  
    android:pivotY="50%"  
    android:fromDegrees="0"  
    android:toDegrees="720" />

viewusage's People

Contributors

ruijiao avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.