android imageview上边角有黑边_Android 开发技术周报 Issue#284

c4855f1dd235a30fcb7a6bafd28eac33.png

新闻

  1. Android 11更新媒体存储API 第三方App也可用上回收站[1]

  2. 长视频录制不用愁:Android 11已取消过时的4GB文件容量上限[2]

  3. Android 11 首个测试版来了 这五大重点更新值得你关注[3]

  4. 谷歌改进应用打包格式 以精简Android游戏安装包的尺寸[4]

教程

  1. Android 11 Beta 版正式发布!以及众多面向开发者的重磅更新

  2. Dagger 导航从未如此简单 | Android Studio 4.1

开源库

  1. LPhotoPicker[5]

    ?A beautiful picture selection frame for AndroidX(Support Dark Mode) - 一个漂亮的图片选择库,支持Android 10 的暗黑模式

    6d104bb262338ea1f403b2e5c2c95edd.png

  2. realmfieldnameshelper[6]

    Realm extension library used to create more type-safe queries.

  3. ConsecutiveScroller[7]

    ConsecutiveScrollerLayout是Android下支持多个滑动布局(RecyclerView、WebView、ScrollView等)和普通控件(TextView、ImageView、LinearLayou、自定义View等)持续连贯滑动的容器,它使所有的子View像一个整体一样连续顺畅滑动。并且支持布局吸顶功能。

    361c0c781f8c0660b0bbfd3c06a13f32.gif

  4. Snake[8]

    使用Snake,Android也可以轻松实现类iOS侧滑返回效果

  5. GroupedRecyclerViewAdapter[9]

    GroupedRecyclerViewAdapter可以很方便的实现RecyclerView的分组显示,并且每个组都可以包含组头、组尾和子项;可以方便实现多种Type类型的列表,可以实现如QQ联系人的列表一样的列表展开收起功能,还可以实现头部悬浮吸顶功能等。

    b3ce7dcb25aa823975980c08732e0e48.png

  6. xCamera[10]

    A well designed camera library for Android platform with almost all features you need when making a camera app.

  7. AdaptableBottomNavigation[11]

    A simpler way for implementing the Bottom Navigation View on Android

    208c5b26a8fc523fcbe88754972008ff.gif

  8. BottomNavWatson[12]

    Bottom navigation bar library that allows multiple back stacks and one single navigation graph per application

  9. Mp4Composer-android[13]

    This library generate an Mp4 movie using Android MediaCodec API and apply filter, scale, trim, transcode, crop, timeScale, mute and rotate Mp4.

    f2fa218a21a1d162d2ef1f66f7294b11.png

  10. workflow-kotlin[14]

    A Swift and Kotlin library for making composable state machines, and UIs driven by those state machines.

  11. SimplifySpan[15]

    A easy-to-use and powerful Spannable library

    117b88eb7813311bd85d7010b482110c.gif

  12. BiliShare[16]

    支持分享到微博、QQ聊天、QQ空间、微信聊天、微信朋友圈,系统分享等。

  13. TreeView[17]

    An android tree structure view with high performance and rich features

    b5f61e325a0198c3117c8227e83c9dda.gif

  14. ExoPlayerFilter[18]

    This library uses OpenGL Shaders to apply effects on ExoPlayer video at Runtime

    1940f07cdf1c029d97ad35ffbd9ad6fa.png
  15. ViewPagerBottomSheet[19]

    Use ViewPagers in Bottom Sheets and Bottom Sheet Dialogs!

    84f8c459648d36381485db5ae563a9ab.gif

  16. MagicalCamera[20]

    A library to take picture easy, transform your data in different format and save photos in your device

  17. Nier-Visualizer[21]

    A lightweight and efficient Android visual library.

    45d60f47b1c5d0d26297a4fdf987299e.png

  18. WifiUtils[22]

    a library that provides a set of convenience methods for managing WiFi State, WiFi Scan, And WiFi Connection to Hotspots.

  19. CountryCodePickerProject[23]

    an android library which provides an easy way to search and select country or international phone code. Also supports Android EditText phone mask and international phone validation.

  20. PatternLock[24]

    Material Design Pattern Lock with auth flow implementation

    39a2593412444b3407e50c131fa2ce0a.png

  21. ARCore-Location[25]

    Allows items to be placed within the AR world with real-world GPS coordinates using ARCore.

  22. AvatarView[26]

    A circular Image View with a lot of perks. Including progress animation and highlight state with borders and gradient color.

    d0435e04315a13c197d6d81c68a2748a.png

  23. ToggleButtonGroup[27]

    A group of flowable toggle buttons, with multiple / single selection support and button customization.

    fb75bfa27d4b09ec1968ab24bb273d88.png

  24. PinView[28]

    A PIN view library for Android. Use to enter PIN/OTP/password etc.

    1df33859964223b7b0bc2e900959de53.png

  25. toolbar-button[29]

    FAB to Toolbar Button library for Android Material Collapsing Toolbar

    7c6d63f565444f1119919968a4811e6e.gif

  26. BoardView[30]

    a custom view that allows you to be able to re-order items in a list as well as in a board. You can drag and drop items between columns as well as drag and drop columns.

    e895899327bb307dc3e226415e46e86b.gif

  27. fbd1c4dc57dcee181848ce6d541e522b.png

示例

  1. Jetpack-From-Java-To-Kotlin[31]

    本项目专注于提供 Jetpack 核心组件 从 Java 到 Kotlin 的 对照示例 —— This project focuses on providing comparative examples of the core components of Jetpack from Java to Kotlin.

    fbd1c4dc57dcee181848ce6d541e522b.png

  2. sample-materials-shop[32]

    Sample app for Jetpack Compose Developer Preview 2

    4ed9e194217d22f25ddb93e8d0a15402.png

  3. wire-android-reloaded[33]

    WIP Experiment

App

  1. pin-authentication[34]

    An Android library that provides local PIN authentication for your application.

    57eac11be40764a11ddd37f75ca058ab.png

工具

  1. sndcpy[35]

    This tool forwards audio from an Android 10 device to the computer. It does not require any root access. It works on GNU/Linux, Windows and macOS.

  2. wereader[36]

    ? 一个Chrome插件:微信读书做笔记工具

  3. idea-multimarkdown[37]

    Markdown language support for IntelliJ IDEA.

    c675b09598c29d2dea2fee77bdf55379.png

?福利

d3d97207ef76f2ce8ec6c1a69e60187e.png

?往期周报

979b081476687816853338c1ab00d509.png 029c18eb6b5ada3f57a384ea8654b69e.png 94b19b3fd7ead3d567beeeb57b9daddf.png

? 链接

[1]

Android 11更新媒体存储API 第三方App也可用上回收站: https://www.cnbeta.com/articles/tech/990617.htm

[2]

长视频录制不用愁:Android 11已取消过时的4GB文件容量上限: https://www.cnbeta.com/articles/tech/990619.htm

[3]

Android 11 首个测试版来了 这五大重点更新值得你关注: https://www.cnbeta.com/articles/tech/990731.htm

[4]

谷歌改进应用打包格式 以精简Android游戏安装包的尺寸: https://hot.cnbeta.com/articles/game/989209.htm

[5]

LPhotoPicker: https://github.com/limuyang2/LPhotoPicker

[6]

realmfieldnameshelper: https://github.com/cmelchior/realmfieldnameshelper

[7]

ConsecutiveScroller: https://github.com/donkingliang/ConsecutiveScroller

[8]

Snake: https://github.com/yuanhoujun/Snake

[9]

GroupedRecyclerViewAdapter: https://github.com/donkingliang/GroupedRecyclerViewAdapter

[10]

xCamera: https://github.com/Shouheng88/xCamera

[11]

AdaptableBottomNavigation: https://github.com/bufferapp/AdaptableBottomNavigation

[12]

BottomNavWatson: https://github.com/cookpad/BottomNavWatson

[13]

Mp4Composer-android: https://github.com/MasayukiSuda/Mp4Composer-android

[14]

workflow-kotlin: https://github.com/square/workflow-kotlin

[15]

SimplifySpan: https://github.com/iwgang/SimplifySpan

[16]

BiliShare: https://github.com/bilibili/BiliShare

[17]

TreeView: https://github.com/shineM/TreeView

[18]

ExoPlayerFilter: https://github.com/MasayukiSuda/ExoPlayerFilter

[19]

ViewPagerBottomSheet: https://github.com/laenger/ViewPagerBottomSheet

[20]

MagicalCamera: https://github.com/fabian7593/MagicalCamera

[21]

Nier-Visualizer: https://github.com/bogerchan/Nier-Visualizer

[22]

WifiUtils: https://github.com/ThanosFisherman/WifiUtils

[23]

CountryCodePickerProject: https://github.com/hbb20/CountryCodePickerProject

[24]

PatternLock: https://github.com/zhanghai/PatternLock

[25]

ARCore-Location: https://github.com/appoly/ARCore-Location

[26]

AvatarView: https://github.com/vitorhugods/AvatarView

[27]

ToggleButtonGroup: https://github.com/nex3z/ToggleButtonGroup

[28]

PinView: https://github.com/ChaosLeung/PinView

[29]

toolbar-button: https://github.com/GautamGupta/toolbar-button

[30]

BoardView: https://github.com/jakebonk/BoardView

[31]

Jetpack-From-Java-To-Kotlin: https://github.com/Jetpack-Missionary/Jetpack-From-Java-To-Kotlin

[32]

sample-materials-shop: https://github.com/romainguy/sample-materials-shop

[33]

wire-android-reloaded: https://github.com/wireapp/wire-android-reloaded

[34]

pin-authentication: https://github.com/05nelsonm/pin-authentication

[35]

sndcpy: https://github.com/rom1v/sndcpy

[36]

wereader: https://github.com/liuhao326/wereader

[37]

idea-multimarkdown: https://github.com/vsch/idea-multimarkdown

9a0e47f26abad281cf161c2703a55fbd.png

扫一扫关注公众号和投稿分享你的文章/开源项目

觉得内容不错点个「在看」哦♥️

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要让ImageView中的图片居中显示,可以使用以下几种技巧: 1. 使用android:scaleType属性 在XML布局文件中,将ImageView的scaleType属性设置为centerCrop或centerInside可以实现图片居中显示。其中,centerCrop会将图片等比例缩放至完全填充ImageView,同时保持图片的宽高比,可能会裁剪图片的一部分;centerInside会将图片等比例缩放至完全显示在ImageView内部,可能会留有空白区域。 示例代码: ``` <ImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/image" android:scaleType="centerCrop" /> ``` 2. 使用RelativeLayout布局 在RelativeLayout布局中,可以使用android:layout_centerInParent属性将ImageView居中显示。 示例代码: ``` <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/image" android:layout_centerInParent="true" /> </RelativeLayout> ``` 3. 使用ConstraintLayout布局 在ConstraintLayout布局中,可以使用Guideline或者ConstraintLayout的属性将ImageView居中显示。 示例代码: ``` <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/image" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> ``` 以上是三种常用的让ImageView中的图片居中显示的技巧,可以根据实际情况选择使用。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值