zoukankan      html  css  js  c++  java
  • Android setCompoundDrawablesWithIntrinsicBounds手工设置文本与图片相对位置说明

    Android setCompoundDrawablesWithIntrinsicBounds手工设置文本与图片相对位置说明

    setCompoundDrawablesWithIntrinsicBounds(left, top, right, bottom)意思是设置Drawable显示在text的左、上、右、下位置(Textview、Button都以),作用效果和以下的xml布局中绿色背景那行代码一样,两个结合使用可以对图片进行变化

     

    XML文件布局:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
    
        <TextView
            android:id="@+id/btn1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawableTop="@drawable/t1"
            android:text="tete"
            />
    </LinearLayout>
  • 相关阅读:
    hibernateValidator 升级
    java异常
    reids过期键三种删除策略
    hashmap源码探究
    http知识梳理1
    GregorianCalendar类的使用
    计算机网络笔记
    List的toArray方法
    实习周记一
    vue指令详解
  • 原文地址:https://www.cnblogs.com/lyd447113735/p/8202719.html
Copyright © 2011-2022 走看看