Ich versuche, den Code in diesem Tutorial "Subsampling Scale Image View" zu testen, um ein Zoombild Pinch machen, aber es gibt einen Fehler auf .findViewById (id. imageView); - kann nicht lösen Symbol ..Fehler bei findViewById - Subsampling Scale Bildansicht - Android
Mein XML-Layout:
<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>
Und auf meinem MainActivity
Fragment-Code hat diesen Code (innen onCreate-Methode):
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));
}
}
Kann jemand bitte helfen mir bitte?
Dank im Voraus CAFC
-6 downvotes ... Wow –
Ich habe keine Ahnung, warum sie diese Antwort 6 mal downvoted. Upvoted es, was für eine Last von bs. – Jordy