android-fill_parent不在LinearLayout中填充整个屏幕

android-fill_parent不在LinearLayout中填充整个屏幕,第1张

概述我试图搜索此答案,而我最接近答案的是添加android:resizable=“true”,该名称已弃用.如果这个问题已得到解答,我深表歉意,但如果找到,我找不到.无论如何,我的应用程序无法充满整个屏幕.我使用的方法在android2.2中有效,但是我现在使用的是2.3模拟器,它不起作用.我不确定这是否是

我试图搜索此答案,而我最接近答案的是添加android:resizable =“ true”,该名称已弃用.如果这个问题已得到解答,我深表歉意,但如果找到,我找不到.

无论如何,我的应用程序无法充满整个屏幕.我使用的方法在androID 2.2中有效,但是我现在使用的是2.3模拟器,它不起作用.我不确定这是否是问题所在.

现在解决问题…

我正在创建一个温度转换器应用程序(是的,这是家庭作业),即使我为linearLayout中的layout_wIDth和height说fill_parent,该应用程序也无法填充整个屏幕.我看到的建议是使用relativeLayout,我可以做到这一点,但这似乎是一个创可贴,而不是解决方案.这不行吗?

这是我的代码:

<?xml version="1.0" enCoding="utf-8"?><linearLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"    androID:orIEntation="vertical"    androID:layout_wIDth="fill_parent"    androID:layout_height="fill_parent"    androID:gravity="center_vertical"    androID:background="@color/white"    >    <TextVIEw          androID:layout_wIDth="fill_parent"         androID:layout_height="wrap_content"         androID:text="Temperature Converter"        androID:textcolor="@color/black"        />    <RadioGroup xmlns:androID="http://schemas.androID.com/apk/res/androID"        androID:ID="@+ID/convertGroup"        androID:orIEntation="vertical"        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content"        >        <Radiobutton androID:ID="@+ID/CtoF"            androID:orIEntation="vertical"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Celsius to Fahrenheit"            androID:textcolor="@color/black"            />        <Radiobutton androID:ID="@+ID/FtoC"            androID:orIEntation="vertical"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content"            androID:text="Fahrenheit to Celsius"            androID:textcolor="@color/black"            />    </RadioGroup>    <EditText        androID:ID="@+ID/tempinput"        androID:layout_wIDth="fill_parent"         androID:layout_height="wrap_content"        androID:singleline="true"        androID:hint="Temperature"    />    <TextVIEw          androID:ID="@+ID/converted"        androID:layout_wIDth="fill_parent"         androID:layout_height="wrap_content"         androID:textcolor="@color/black"    /></linearLayout>

结果如下:

解决方法:

在应用程序标记后的清单中添加以下代码

<supports-screens androID:resizeable="true"                      androID:smallScreens="true"                       androID:normalScreens="true"                       androID:largeScreens="true"                      androID:anyDensity="true" />
总结

以上是内存溢出为你收集整理的android-fill_parent不在LinearLayout中填充整个屏幕全部内容,希望文章能够帮你解决android-fill_parent不在LinearLayout中填充整个屏幕所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1094109.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存