Hello,
[Primary Question]
I have a SfRating inside a RelativeLayout, which is inflated by a AlertDialog that isn't centering the control horizontally. Below is the AXML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.syncfusion.rating.SfRating
android:id="@+id/rate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
All others controls are centered horizontally when android:layout_centerHorizontal="true" inside a RelativeLayout. SfRating should've done the same, right?
I managed that using the hack below:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.15">
</RelativeLayout>
<RelativeLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.7">
<com.syncfusion.rating.SfRating
android:id="@+id/rate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dip"
android:layout_height="fill_parent"
android:layout_weight="0.15">
</RelativeLayout>
</LinearLayout>
[Secondary Question]
Is that a way that i can set the ItemSize to be scalable, according to the screen size?
Example: If a set ItemSize to 30, in a 5' screen, using the hack AXML above, is ok, but in a 3,5' screen, just appears 3 stars.
Thanks in advance.
Regards,
Leonardo Souza