2018/8/13

<ImageView
android:src="@drawable/Picture location"
android:
/>

android:scaleType="center".
使图像在视图中居中,但不执行缩放。
android:scaleType="centerCrop".
缩放图像(保持图像的纵横比),使得图像的尺寸(宽度和高度)都等于或大于视图的相应维度(减去填充)。然后将图像集中在视图中。


CENTER
added in API level 1
public static final ImageView.ScaleType CENTER
Center the image in the view, but perform no scaling. From XML, use this syntax: android:scaleType="center".


CENTER_CROP
added in API level 1
public static final ImageView.ScaleType CENTER_CROP
Scale the image uniformly (maintain the image’s aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding). The image is then centered in the view. From XML, use this syntax: android:scaleType="centerCrop".
API参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1 package com.alibaba.traffic.web; 2 3 import java.io.UnsupportedEncodingException; 4 import java.security.InvalidKeyException; 5 import java.security.NoSuchAlgorithmException; 6 7 import javax.crypto.Mac; 8 import javax.crypto.SecretKey; 9 import javax.crypto.spec.SecretKeySpec; 10 11 import org.apache.commons.codec.binary.Hex; 12 特别注意 附件 6 13 /** 14 * @author dongdong.fdd 15 * @date 2018/9/27 上午11:29 16 */ 17 public class T { 18 public static void main(String[] args) 19 throws InvalidKeyException, UnsupportedEncodingException, No SuchAlgorithmException { 20 long timestamp = System.currentTimeMillis() / 1000; 21 String paramValuesStr = "allAMAP-TRAFFIC-BRAIN10" + timestam p;//该值为排好序的参数的参数值拼接结果 22 String clientSecret = "testclientsecret";//该值为申请到的client Secret 23 24 Mac mac = Mac.getInstance("HmacSHA256"); 25 byte[] secretByte = clientSecret.getBytes("UTF-8"); 26 byte[] dataBytes = paramValuesStr.getBytes("UTF-8"); 27 28 SecretKey secretKey = new SecretKeySpec(secretByte,"HMACSHA2 56"); 29 mac.init(secretKey); 30 31 byte[] doFinal = mac.doFinal(dataBytes); 32 byte[] hexB = new Hex().encode(doFinal); 33 34 String digest = new String(hexB, "utf-8");//计算好的签名 26f2042cde2e9ca01d41ecdb27a91fd9b84f0263c411bcb13b195ec589096885 35 System.out.println(digest); 36 37 String resultUrl = "http://et-api.amap.com/index/cityRankin g?adcodes=all&clientKey=AMAP-TRAFFIC-BRAIN&size=10&timestamp="+times tamp+"&digest=" + digest; 38 System.out.println(resultUrl); 39 } 将这段代码使用python实现
07-14

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值