将代码编译成apk时,图片不会显示在android studio上,但没有错误。文本字段很好
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_maint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/jpg"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
>
<TextView
android:text="MY SOCIAL"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:textColor="#fff"
android:gravity="center"
android:textSize="25dp"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="133dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/faceboooook"
android:id="@+id/imageView1"
android:layout_weight="1"
tools:ignore="ContentDescription" />
...
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="133dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/twitter"
android:id="@+id/imageView95"
android:layout_weight="1" />
...
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="133dp">
<ImageView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:srcCompat="@drawable/rosinsta"
android:id="@+id/imageView9"
android:layout_weight="1" />
...
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ross"
android:id="@+id/imageButton"
android:layout_weight="1" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/about"
android:id="@+id/imageButton2"
android:layout_weight="1" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/contacts"
android:id="@+id/imageButton3"
android:layout_weight="1" />
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/exit"
android:id="@+id/imageButton5"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
将代码编译成apk时,图片不会显示.thats android studio
答案 0 :(得分:0)
为什么不在LinearLayout中设置图像.. !!