Skip to content Skip to sidebar Skip to footer

Android Rating Bar Xml And Numstars

I'm a beginner in designing with XML :D This is the XML of my rating bar and friends : Copy

I think android:gravity="center_vertical" was the problem.

Solution 2:

Okay, i have an idea to use a relative layout and i also use a little drag-drop :

<LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:weightSum="2" ><TextViewandroid:id="@+id/txtTitle"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_marginBottom="5dp"android:layout_marginTop="5dp"android:layout_marginLeft="5dp"android:gravity="center_vertical"android:textColor="#336699"android:textSize="18dp"android:textStyle="bold"android:layout_weight="1"
        /><RelativeLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"
        ><RatingBarandroid:id="@+id/rtbHighScore"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_marginBottom="15dp"android:layout_marginTop="15dp"android:layout_marginRight="45dp"android:numStars="5"android:max="100"android:rating="0.0"android:stepSize="0.0"style="?android:attr/ratingBarStyleSmall"
            /><ImageViewandroid:id="@+id/imgRow"android:layout_width="wrap_content"android:layout_height="match_parent"android:layout_alignParentLeft="true"android:layout_alignParentTop="true"android:layout_marginLeft="96dp"android:src="@drawable/rightarrow" /></RelativeLayout></LinearLayout>

And this code make my layout "perfect"

Post a Comment for "Android Rating Bar Xml And Numstars"