Android开发之ImageView文本组件的…

Android开发之ImageView文本组件的使用
1,将我们的图片复制到res下边的drawable-hdpi文件夹下边
2,修改res下边的layout下边的xml文件

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10px"
        android:text="图片视图引用" />
<ImageView 
      android:id="@+id/img1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_marginTop="30px"
      android:maxHeight="50px"
      android:maxWidth="50px"       
      android:src="@drawable/view"/>
</RelativeLayout>

你可能感兴趣的:(Android开发之ImageView文本组件的…)