您好,欢迎来到源码搜藏!分享精神,快乐你我!提示:担心找不到本站?在百度搜索“源码搜藏”,网址永远不丢失!
  • 首 页
  • 在线工具
  • Android的设计素材UI库(包括按钮,开关,进度条,滑块,对话,

    时间:2016-08-18 16:58 来源:互联网 作者:源码搜藏 浏览:收藏 挑错 推荐 打印

    如何使用

    如果你想使用这个库,你只需要下载MaterialDesign项目,将其导入到你的工作空间,并添加项目在你的Android项目设置库。

    如果你喜欢它,你可以使用gradle这个依赖,你已经在你的build.gradle文件中添加这些行:

    
    	
    repositories {
        jcenter()
    }
    
    dependencies {
        compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
    }

    某些组件具有自定义属性,如果你想使用它们,你必须在第一部分XML文件中加入这一行:

    < RelativeLayout  xmlns : android = " http://schemas.android.com/apk/res/android "
         xmlns : materialdesign = " http://schemas.android.com/apk/res-auto "
         android : layout_width = " match_parent "
         android : layout_height = " match_parent " 
        > 
    </ RelativeLayout >

    如果你要使用滚动型,建议您使用这个库中提供的CustomScrollView以避免与自定义组件的问题。要使用这个组件:

    < com .gc.materialdesign.views.ScrollView 
        xmlns : android = " http://schemas.android.com/apk/res/android "
        xmlns : materialdesign = " http://schemas.android.com/apk/res-auto "
        android : id = " @+id/scroll "
        android : layout_width = " match_parent "
        android : layout_height = " match_parent " > 
    </ com .gc.materialdesign.views.ScrollView>

    组件

    纽扣

    平底

    平按钮

    < com .gc.materialdesign.views.ButtonFlat
                     android : id = " @+id/buttonflat "
                     android : layout_width = " wrap_content "
                     android : layout_height = " wrap_content "
                     android : background = " #1E88E5 "
                     android : text = " Button " />
    矩形按钮

    矩形按钮

    < com .gc.materialdesign.views.ButtonRectangle
                     android : id = " @+id/button "
                     android : layout_width = " wrap_content "
                     android : layout_height = " wrap_content "
                     android : background = " #1E88E5 "
                     android : text = " Button " />
    浮动按钮

    浮动按钮

    建议把这个组件在屏幕的右下角。要在XML文件中使用这个组件编写代码。如果我想知道我开始这个组件动画的动画属性设置为false。把你的图标,在图标属性来设置此组件的绘制图标

    < RelativeLayout  xmlns : android = " http://schemas.android.com/apk/res/android "
         xmlns : materialdesign = " http://schemas.android.com/apk/res-auto "
         android : layout_width = " match_parent "
         android : layout_height = " match_parent " 
        > <!-- ... XML代码--> 
        < com .gc.materialdesign.views.ButtonFloat
                     android : id = " @+id/buttonFloat " android : layout_width = " wrap_content " android : layout_height = " wrap_content " android : layout_alignParentRight = " true " android : layout_alignParentBottom = " true " android : layout_marginRight = " 24dp " android : background = " #1E88E5 " materialdesign : animate = " true " materialdesign : iconDrawable = " @drawable/ic_action_new " /> 
    </ RelativeLayout >
                
    浮法小按钮

    漂浮小按钮

    < com .gc.materialdesign.views.ButtonFloatSmall
                     android : id = " @+id/buttonFloatSmall "
                     android : layout_width = " wrap_content "
                     android : layout_height = " wrap_content "
                     android : background = " #1E88E5 "
                     materialdesign : iconDrawable = " @drawable/ic_action_new " />

    开关

    复选框

    复选框

    < com .gc.materialdesign.views.CheckBox
                     android : id = " @+id/checkBox "
                     android : layout_width = " wrap_content "
                     android : layout_height = " wrap_content "
                     android : background = " #1E88E5 "
                     materialdesign : check = " true " />
    开关

    开关

    < com .gc.materialdesign.views.Switch
                     android : id = " @+id/switchView "
                     android : layout_width = " wrap_content "
                     android : layout_height = " wrap_content "
                     android : background = " #1E88E5 "
                     materialdesign : check = " true " />

    进展指标

    进度条圆形不确定

    进度条圆形不确定

    < com .gc.materialdesign.views.ProgressBarCircularIndeterminate
                     android : id = " @+id/progressBarCircularIndeterminate "
                     android : layout_width = " 32dp "
                     android : layout_height = 

    Android的设计素材UI库(包括按钮,开关,进度条,滑块,对话,转载请注明出处http://www.codesocang.com/kj/anniu/33444.html 源码搜藏网所有源码来自用户上传分享,版权问题及牵扯到商业纠纷均与源码搜藏网无关
    标签: