//第一步 build Project 下:写入 maven { url "https://jitpack.io" }
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
//第二步 导依赖:
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
//第三步 布局:
<uk.co.senab.photoview.PhotoView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/photo_view" />
//第四步 就可以赋值使用了:
public class MainActivity extends AppCompatActivity { @BindView(R.id.photo_view) ImageView photo_view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Unbinder bind = ButterKnife.bind(this); photo_view.setImageResource(R.mipmap.ic_launcher); }
//------------------------------------------------------------------完------------------------------------------------------------------------------