1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#444548">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/image"
>
</ImageView>
<TextView android:id="@+id/TextView01"
android:textColor="#ffffff"
android:layout_width="wrap_content"
android:text="@+id/TextView01" android:layout_height="wrap_content">
</TextView>
</LinearLayout>
im appeler mon textview dans ma classe .java comme ceci:appeler un imageView dans ma classe .java
TextView tv1 = (TextView) findViewById(R.id.TextView01);
tv1.setText("Welcome to Schogini!");
est-il possible de le faire pour une image aussi grâce
merci! Cela fonctionne mais vous devez le changer en im.setImageResource (R.drawable.icon); –
désolé pour mon erreur –