есть два LinearLayout buttonLinearLayout и nextButtonLinearLayout. На данный момент они находятся один под другим. В коде в зависимости от надобности один скрывается другой появляется таким вот кодом.
nextButtonLinearLayout.setVisibility(LinearLayout.INVISIBLE);
buttonLinearLayout.setVisibility(LinearLayout.VISIBLE);
Но есть проблема в том, что кнопки находятся на разных местах по высоте и получается некрасивый переход. Просьба подсказать, как сделать так чтобы кнопки были на одном уровне.
Код активности ниже.
<TextView
android:id="@+id/jokeTextView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:gravity="center"
android:textSize="@dimen/joke_text_view" />
<LinearLayout
android:id="@+id/buttonLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/yesButton"
style="?attr/buttonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/yesButton" />
<Button
android:id="@+id/noButton"
style="?attr/buttonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/noButton" />
</LinearLayout>
<LinearLayout
android:id="@+id/nextButtonLinearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/nextButton"
style="?attr/buttonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/nextButton" />
</LinearLayout>