[英]Image showing in preview but not on Android tablet. XML issue?
So I have been working on an Android application to make an application for use with DJI's consumer level drones. 因此,我一直在开发一个Android应用程序,以使该应用程序可与DJI的消费者级无人机一起使用。 I have been making the user interface and using XML throughout the project with no issues.
我一直在制作用户界面,并在整个项目中使用XML都没有问题。 I want to add a .png to the UI just so that my logo is showing.
我只想向用户界面添加.png以便显示徽标。 When I preview it in Android Studio, I can see the logo being shown but when it is run on the tablet, it is not there.
在Android Studio中预览时,可以看到显示的徽标,但是在平板电脑上运行时,该徽标不存在。 Everything else using XML is fine though.
不过,使用XML的其他一切都很好。 I even preview using the same resolution/ screen size as my tablet I am using (cheap Hudl 2 tablet).
我什至使用与我使用的平板电脑相同的分辨率/屏幕尺寸进行预览(便宜的Hudl 2平板电脑)。
If anybody has any ideas about how I can get this to work, I would appreciate it. 如果有人对我如何使其工作有任何想法,我将不胜感激。 I have shown my university lecturer it and he couldn't give me an answer too as nothing seems to be out of the ordinary.
我已经向我的大学讲师展示了它,他也无法给我答案,因为似乎没有什么不寻常的。
Android studio preview Android Studio预览
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/macrosfordji"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
Try this (android:src="..." instead app:srcCompat="..."): 试试这个(android:src =“ ...”代替app:srcCompat =“ ...”):
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/macrosfordji"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.