按钮不改变位置

问题描述:

在我的XML文件中,一切看起来都是我想要的,但是在我的手机和模拟器中有两个按钮交换位置。 这里是我的XML(这是很长,所以我只能粘贴相关的部分):按钮不改变位置

<?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="match_parent"> 
     <LinearLayout 
     android:id="@+id/contentLayout" 
     android:layout_height="match_parent" 
     android:layout_width="match_parent" 
     android:orientation="vertical" 
     android:gravity="center"> 

      <LinearLayout 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:gravity="center" 
       android:orientation="horizontal" 
       android:paddingTop="5dp"> 
       <Button 
        android:id="@+id/buttonBack" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:background="@drawable/indexmenu_button" 
        android:layout_marginRight="8dp" 
        android:layout_marginLeft="0dp" /> 
       <Button 
        android:id="@+id/buttonChannelList" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginRight="8dp" 
        android:layout_marginLeft="8dp" 
        android:text="" 
        android:background="@drawable/channelnotselected"/> 
       <Button 
        android:id="@+id/buttonFavoriteChannelList" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginRight="8dp" 
        android:layout_marginLeft="8dp" 
        android:text="" 
        android:background="@drawable/favoritelistnotselected"/> 

所以按钮“@ + ID/buttonChannelList”和“@ + ID/buttonFavoriteChannelList”在XML图形视图正确代码视图,但正如我所说,他们交换手机和模拟器的地方。 可能是什么原因?

+0

尝试清理和重建项目。我想和凯尔一样。 – PhatHV 2012-03-15 01:15:26

我看不出有任何理由,也许你可以尝试Project -> Clean重建

+0

我应该认为,谢谢 – tan 2012-03-15 21:18:07