【问题标题】:Android: an xml that doesn't work properly (framelayout and imageviewAndroid:无法正常工作的 xml(framelayout 和 imageview
【发布时间】:2012-06-28 14:41:50
【问题描述】:

我有这个 xml:

<?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:orientation="vertical" >
<ImageView
    android:src="@drawable/head"
/> 
<FrameLayout
android:layout_width="200dip" 
android:layout_height="200dip" 
android:layout_gravity="center_horizontal">
    <include layout="@layout/capture"/>
</FrameLayout>

</LinearLayout>

它必须在二维码阅读器下方显示图像,该二维码阅读器取自为查看二维码捕获相机而创建的外部 apk 库。
它仅在我删除 imageviev 时才有效。
为什么? 我需要图像和包含。 谢谢

【问题讨论】:

  • Jack57 是正确的,实际上 LogCat 说了什么是错的。

标签: android include frame qr-code


【解决方案1】:

您需要为 ImageView 提供更多属性,例如:

android:layout_width="fill_parent"
android:layout_height="fill_parent"

【讨论】:

  • mmm... uao,很明显 XD,你知道为什么,如果我添加:requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);在java上,它崩溃了吗?我用它来删除顶部的 android 栏,但在这里它不起作用
  • 我建议你再问一个问题,因为我需要更多信息,而且 cmets 中的格式很差。
  • 我已经通过使用 android manifest 解决了。对不起,但我没有能力以人类的方式阅读 logcat ......这是我需要研究的一点
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-14
相关资源
最近更新 更多