このチュートリアル「サブサンプリング スケール イメージ ビュー」のコードをテストしてズーム イメージ ピンチを作成しようとしていますが、.findViewById(id. imageView );で 1 つのエラーが発生します。-シンボルを解決できません..
私のXMLレイアウト:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
そして私のMainActivity
フラグメントコードには、このコードがあります(onCreateメソッド内):
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SubsamplingScaleImageView imageView = (SubsamplingScaleImageView)findViewById(id.imageView);
imageView.setImage(ImageSource.resource(R.drawable.abc));
}
}
誰でも私を助けてくれませんか?
よろしくお願いします