android - 从特定位置剪切图像
问题描述
我的水平回收器视图中有以下行项目-
如您所见,我从服务器获得的项目很广泛。我想要的是将图像宽度削减一些值,但我希望从线条开始的位置到图像的右端进行切割。
这是我的 XML -
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="303dp"
android:layout_height="80dp">
<android.support.v7.widget.CardView
android:id="@+id/search_image_contact_cardview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
app:cardCornerRadius="8dp">
<ImageView
android:id="@+id/vendorImageview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
tools:src="@mipmap/ic_launcher" />
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
我从服务器获得的原始图像是 303DP,我需要将其切成两半 - 从我画的线开始的位置开始切割,而不是从图像实际开始的位置开始切割。
我怎样才能实现这种行为?
解决方案
推荐阅读
- python - 使用 virtualenv 更改现有虚拟环境的 python 版本时出错
- websphere - 使用在 RHEL 中运行的 IBM WAS 9 将 PDF 保存到 TIFF 文件时出现字符错误
- java - Java、SQL 数据库连接错误
- json - 在 Redux 中获取 json 对象的 mapStateToProps() 中的错误
- laravel-5 - Laravel 雄辩:在具有多个关系的查询中使用“colllection”重命名列名
- html - 图像CSS上的重叠文本
- reactjs - react-360 没有创建项目
- php - htaccess 总是将 POST 请求重定向到 GET 请求。
- python - 我如何执行枚举?
- ubuntu - 在 ubuntu pycharm 中我找不到 anaconda 包