zoukankan      html  css  js  c++  java
  • 2021/2/25

    今日学习内容

    Button(按钮)与ImageButton(图像按钮)

            drawable:引用的Drawable位图,我们可以把他放到最前面,就表示组件的正常状态~
            state_focused:是否获得焦点
            state_window_focused:是否获得窗口焦点
            state_enabled:控件是否可用
            state_checkable:控件可否被勾选,eg:checkbox
            state_checked:控件是否被勾选
            state_selected:控件是否被选择,针对有滚轮的情况
            state_pressed:控件是否被按下
            state_active:控件是否处于活动状态,eg:slidingTab
            state_single:控件包含多个子控件时,确定是否只显示一个子控件
            state_first:控件包含多个子控件时,确定第一个子控件是否处于显示状态
            state_middle:控件包含多个子控件时,确定中间一个子控件是否处于显示状态
            state_last:控件包含多个子控件时,确定最后一个子控件是否处于显示状态

    <?xml version="1.0" encoding="utf-8"?>
    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:state_pressed="true" android:drawable="@drawable/ic_course_bg_fen"/>
        <item android:state_enabled="false" android:drawable="@drawable/ic_course_bg_pressed"/>
        <item android:drawable="@drawable/ic_course_bg_cheng"/>
    </selector>

    <Button
            android:id="@+id/btnOne"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:background="@drawable/btn_bg1"
            android:text="按钮"/>
        
        
        <Button
            android:id="@+id/btnTwo"
            android:layout_width="match_parent"
            android:layout_height="64dp"
            android:text="按钮不可用"/>
  • 相关阅读:
    敌兵布阵(线段树单点更新+区间查询)
    小明上学(CCF认证2018-12-1 )
    There Are Two Types Of Burgers (Educational Codeforces Round 71)
    Bad Prices ( Codeforces Round #582 )
    Redis热点key优化
    Redis big key处理
    Redis的安全问题
    Redis的flushall/flushdb误操作
    Redis在linux系统中的优化
    Redis之缓存设计
  • 原文地址:https://www.cnblogs.com/qiangini/p/14905211.html
Copyright © 2011-2022 走看看