lundi 29 juin 2015

dimens file in values-sw360dp clashes with nexus4 & nexus5 UI

Creating an application in portrait mode where I have to align Button on image based on top margin. I'm using dimens file in values-sw360dp which is looking proper in nexus 5 but the same values is not aligning the Buttons in nexus 4 as both of the devices using values-sw360dp folder for dimens file.

Can you please suggest the solution for this. Also can any one provide list of all possible values folder that should be integrated to support multiple screens

Following is the code:

<RelativeLayout xmlns:android="http://ift.tt/nIICcg"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/windowBackground">


    <ImageView
        android:id="@+id/bc_logo"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitStart"
        android:src="@drawable/bc_imgbc_logo" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/bc_logo"
        android:orientation="horizontal"
        android:weightSum="1"
        android:layout_alignParentTop="true"
        android:layout_marginTop="@dimen/bc_img_margin_top">

        <Button
            android:id="@+id/login_btn"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:background="@drawable/signing_tab_btn"
            android:text="SIGN IN"
            android:textColor="@color/colorAccent" />

        <Button

            android:id="@+id/registration_btn"
            style="?android:attr/buttonBarButtonStyle"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:text="REGISTER"
            android:textColor="#FFFFFF" />


    </LinearLayout>
</RelativeLayout

In above code I need to align the LinearLayout on the ImageView so using android:layout_marginTop="@dimen/bc_img_margin_top"for setting margin.

Aucun commentaire:

Enregistrer un commentaire