Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对来自 gihub 的 photoview lib 有疑问...如何将图像投射到 photoview?我在 .java 文件中有一个错误,没有更多...!!!
它是我的 XML 文件的图像
你应该把它放在里面onCreate而不是外面。
onCreate
protected void onCreate(Bundle bundle){ super.onCreate(bundle); setContentView(R.layout.activity_main); PhotoView view = (PhotoView) findViewById(R.id.photo_view); view.setImageResource( your-image-here ); }