该代码是AS共享
<GridLayout
android:id="@+id/gridLayout"
android:layout_width="368dp"
android:layout_height="368dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/board"
android:columnCount="3"
android:rowCount="3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/imageView1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:tag="0" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="17dp"
android:tag="1" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="12dp"
android:tag="2" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginTop="13dp"
android:tag="3" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="17dp"
android:layout_marginTop="13dp"
android:tag="4" />
<ImageView
android:id="@+id/imageView6"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="13dp"
android:tag="5" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginTop="16dp"
android:tag="6" />
<ImageView
android:id="@+id/imageView8"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="17dp"
android:layout_marginTop="16dp"
android:tag="7" />
<ImageView
android:id="@+id/imageView9"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_margin="10dp"
android:layout_marginLeft="12dp"
android:layout_marginTop="16dp"
android:tag="8" />
</GridLayout>
NO Images are seen 这个问题没有解决,请帮忙 但是这个东西正在Andriod Emulator上运行 The same Thing is working in EMultaor
我也重新安装了android studio,但徒劳无功 我还尝试过通过创建新项目并重新启动应用程序
答案 0 :(得分:0)
如果要在设计预览中显示它们,则需要在ImageViews中指定Assertions.assertThat(planRepository.findAllBy(planA.getId()))
// assert result size
.hasSize(2)
// extract a field to assert
.extracting(ViewPlanDetailDto::getPlanDetail)
// extract still finer fields to assert
.extracting(PlanDetail::getId, p -> p.getModule().getName(), p -> p.getModule().geDescription(), ... other fields to assert)
// declare values expected
.containsExactly(Tuple.tuple(planDetailA.getId(), "CSS", "CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.",
planDetailB.getId(), "HTML", "Hypertext Markup Language is the standard markup language for creating web pages and web applications.",
... other expected tuples ));
。
如果您仅在Activity类中设置Image,例如
android:src="@..."
在程序执行之前它们不会显示。