Ich habe zwei Tasten prev
und next
in eine RelativeLayout
platziert. Als ich die letzte Seite meiner App erreichen, bin ich das Deaktivieren der next
Taste:Ändern der Tastenausrichtung der Taste A, wenn Taste B GONE ist
next.setVisibility(View.GONE);
Die Ausrichtung der prev
Taste unterbrochen wird. Ich möchte, dass es auf die Mitte des RelativeLayout
ausgerichtet ist, als ob es nur einen Knopf gäbe.
Hier ist mein Code:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:layout_below="@+id/radgroup"
>
<Button
android:layout_marginTop="14dp"
android:layout_marginLeft="20dp"
android:text="@string/previous"
android:textAllCaps="false"
android:textSize="23dp"
android:layout_width="150dp"
android:layout_height="70dp"
android:id="@+id/prev"
android:onClick="viewPreviousQuestion"
/>
<Button
android:layout_marginTop="14dp"
android:layout_marginLeft="20dp"
android:text="@string/previous"
android:textAllCaps="false"
android:textSize="23dp"
android:layout_width="150dp"
android:layout_height="70dp"
android:layout_toRightOf="@+id/prev"
android:id="@+id/nxt"
android:onClick="viewNextQuestion"
/>
</RelativeLayout>
und das onClick
Ereignis ist
public void viewNextQuestion(View view) {
if(currqstn==lastqstn){
next.setVisibility(View.GONE);
}
}
poste deinen Layoutcode ... –