问题描述:

http://tinypic.com/r/abmhs3/8

This image shows a sing in or sign up button and above of it a skip button. How can I create these buttons?

Whenever I try to create a button like the sign up button as fill_parent width It does not commit all the way to the end of the screen but rather stops.

Sorry for the beginner question. I have been searching online for a solution but could not come across one that could relate to my question.

网友答案:

Try my below code:

<RelativeLayout
    android:id="@+id/login_relLayoutCenter"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true" >

    <Button
        android:id="@+id/skip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:text="Skip"
        android:textColor="#ffffff"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginTop="250dp"
        android:textStyle="bold"
        android:textSize="18sp" />

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/transparent"
        android:text="Sign up or Sign in"
        android:textColor="#ffffff"
        android:layout_below="@+id/skip"
        android:layout_centerHorizontal="true"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginTop="30dp"
        android:textStyle="bold"
        android:textSize="18sp" />





</RelativeLayout>

Screenshot:

相关阅读:
Top