android - 二次采样比例图像视图
问题描述
有谁知道我们如何将一组图像发送到“ SubsamplingScaleImageView ”类...它适用于一个,但是...我只想打开 3 或 4 个图像并在它们之间滑动,我只是可以'找不到路...
任何帮助都会很棒!
这是我的(简单)代码:
主要活动:
private int[] myImages;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myImages = new int[]{
R.drawable.p01, R.drawable.p02
};
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(R.id.imageView);
imageView.setImage(ImageSource.resource(R.drawable.p01));
}
活动主.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.constraint.ConstraintLayout>
谢谢!
解决方案
推荐阅读
- c# - 我可以使用 COM api 过滤 AutoCAD 选择集吗?
- excel - vba:具有命名目的地的复制表
- python - 使用 xgboost 算法预测值
- angular - 如何在 Angular 7 中为 ng2-smart-table 添加验证?
- php - 使用模型名作为变量调用 $this->modelname->methodname()
- angular - 打字稿:没有参数的函数调用
- r - 每个数据帧行到具有 RPS 限制的 httr 正文请求
- javascript - 想要过滤json对象
- mysql - 为什么 apache2 服务器和 mysql 不在 XAMPP 中启动?
- azure - 在哪里可以找到订阅 ID、客户端 ID、机密和租户 ID 的值?