zoukankan      html  css  js  c++  java
  • 2021/4/27

    1.今日收获内容

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
        xmlns:tools="http://schemas.android.com/tools"  
        android:id="@+id/LinearLayout1"  
        android:layout_width="match_parent"  
        android:layout_height="match_parent"  
        android:orientation="vertical"  
        tools:context="com.jay.example.imageviewdemo.MainActivity" >  
      
        <ImageView  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:background="@drawable/pen" />  
      
        <ImageView  
            android:layout_width="200dp"  
            android:layout_height="wrap_content"  
            android:background="@drawable/pen" />  
      
        <ImageView  
            android:layout_width="wrap_content"  
            android:layout_height="wrap_content"  
            android:src="@drawable/pen" />  
      
        <ImageView  
            android:layout_width="200dp"  
            android:layout_height="wrap_content"  
            android:src="@drawable/pen" />  
      
    </LinearLayout> 

    宽高都是wrap_content那就一样,是原图大小,但是,当我们固定了宽或者高的话, 差别就显而易见了,blackground完全填充了整个ImageView,而src依旧是那么大, 而且他居中了哦,这就涉及到了ImageView的另一个属性scaleType了! 另外还有一点,这里我们说了只设置width或者height哦!加入我们同时设置了 width和height的话,blackground依旧填充,但是,src的大小可能发生改变哦! 比如,我们测试下下面这段代码:

    <ImageView  
            android:layout_width="100dp"  
            android:layout_height="50dp"  
            android:src="@drawable/pen" />



    2.遇到的问题


    3.明天目标

    Android

  • 相关阅读:
    GO語言基礎教程:數組,切片,map
    GO語言視頻教程下載
    GO語言基礎教程:流程控制
    GO語言基礎教程:數據類型,變量,常量
    GO語言基礎教程:Hello world!
    GO語言基礎教程:序章
    騰訊RTX的API開發,給RTX開個天窗
    RTX的api開發實例
    [轉]redis;mongodb;memcache三者的性能比較
    [轉載]史上最强php生成pdf文件,html转pdf文件方法
  • 原文地址:https://www.cnblogs.com/qiangini/p/14908365.html
Copyright © 2011-2022 走看看