测试一个小控件总提示force close? 本帖最后由 ocean_dhl 于 2011-03-14 21:34:48 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 就是在main.xml 里面加入了下面这个<EditText android:layout_width="fill_parent" android:layout_height="wrap_content" /> <linearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="确定" /> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="取消" /> </linearLayout> 你把EditText这个控件放<LinearLayout /> </LinearLayout>里面 这样应该也可以吧,只是一个linearlayout的嵌套<?xml version="1.0" encoding="utf-8"?>2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"3android:orientation="vertical"4android:layout_width="fill_parent"5android:layout_height="fill_parent"6>7<TextView8android:layout_width="fill_parent"9android:layout_height="wrap_content"10android:text="He llo World, Bmi"11/><EditText android:layout_width="fill_parent" android:layout_height="wrap_content" /> <linearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right"><buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="确定"/><buttonandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:text="取消"/> </linearLayout>12 </LinearLayout>这是全部的xml代码上面的使部分的,不好意思 把你的所有代码都贴出来瞧瞧呗,包括Activity类 其实,你的main.xml文件,只要是没有提示错误,就没问题。那个,都有固定格式在那。不是重点。关键是你要有VIEWS布局。上次,我调试个程序,也出现个问题。当时一位朋友,告诉我说,是程序的BUG。我还心想,这人忽悠我呢。真想对他说句:“你,你.....你个大忽悠!”但,一天后,我突然发现,是我活动中。java代码,出现了逻辑错误。不怕语法错误。就怕逻辑错误。你的问题,也该出现在这。我认为,你这样的问题,应该试着自己去解决。不行,再重新,写一次,慢慢的,你自己就明白了。当初是如何措的。 就是最简单的刚新建android项目时的代码,没有修改 在学习HttpURLConnection报错FATAL EXCEPTION: main求解 android源码参数设置和一些目录的问题 Android 多点触屏之多个控件同时按下监听 求助!!! 怎么用httpClient实现和socket一样的数据传递? 关于android代码读取文件的问题 利用百度地图SDK 出现的一个问题总是提示myapp已经停止运行! <求助>关于运行Android项目是经常出现的错误 安卓下3G模块选型 安卓百度地图素材 android模拟器上不了网 在后台运行的Service能不能自己接收广播消息?
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<linearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</linearLayout>
2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3android:orientation="vertical"
4android:layout_width="fill_parent"
5android:layout_height="fill_parent"
6>
7<TextView
8android:layout_width="fill_parent"
9android:layout_height="wrap_content"
10android:text="He llo World, Bmi"
11/>
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<linearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
<button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="确定"
/>
<button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="取消"
/>
</linearLayout>
12 </LinearLayout>
这是全部的xml代码
上面的使部分的,不好意思
你的问题,也该出现在这。我认为,你这样的问题,应该试着自己去解决。不行,再重新,写一次,慢慢的,你自己就明白了。当初是如何措的。