В моем 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 и представлении кода, но, как я уже сказал, они меняют места в телефоне и эмуляторе. Что может быть причиной?
Я не вижу причин, поэтому, возможно, вы можете попробовать Project → Clean
и rebuild