布局不更新
问题描述:
我用eclipse打开了一个新的android项目。 编辑布局(在我的情况main.xml)。 一切都很好。在保存我的项目并重新打开之后,我想编辑布局以添加一些按钮。 现在,当我在AVD上运行应用程序时,布局看起来像是在编辑它之前。 一起删除了main.xml
,并在AVD上运行。令我惊讶的是它装载了旧的布局。 怎么回事?布局不更新
这里是我的布局代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".BidirectionalAndroidTCPClientActivity" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<Button
android:id="@+id/connect"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="connect" />
<ToggleButton
android:id="@+id/tog1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="toggle1"
android:text="ToggleButton" />
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/button1"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="clearText"
android:text="Clear Log1" />
<Button
android:id="@+id/button2"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onQuit"
android:text="Exit" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/console" />
<TextView
android:id="@+id/textlog"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>
感谢
答
尝试通过单击上项目,鼠标右键刷新Eclipse项目,而且比刷新。也尝试清理和建立项目。
答
清洁和构建,你会没事的。
路线: 项目 - >清洁。然后检查项目并单击确定。 让我知道这是否解决了您的问题。