rating bar not show all star in single row

user2867267

my rating bar not completely aline in single row see image http://imgur.com/vRGrXU1 last star will not show completely how i will fix this please help me how i will fix this to rating bar show all 5 star completely help me

           <?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="vertical"
 android:padding="10sp" >

 <EditText
    android:id="@+id/Email"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:hint="Email"
    android:singleLine="true" >

    <requestFocus />
</EditText>


   <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"

  android:textColor="#ffffff"

    android:text="Give rating"
    android:textAppearance="?android:attr/textAppearanceLarge" />

  <RatingBar
        android:id="@+id/ratingBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"

        android:numStars="5"
        android:stepSize="1"
        android:rating="0" />





 <EditText
    android:id="@+id/Comments"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ems="10"
    android:layout_marginTop="10dp"
         android:hint="Comments"
   android:minLines="3" >
 </EditText>

 <RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <Button
        android:id="@+id/Submitbtn"
        android:layout_width="120dp"
        android:layout_height="wrap_content"
             android:layout_marginLeft="10dp"
        android:text="Submit" />

    <Button
        android:id="@+id/btn_cancel"
        android:layout_width="120dp"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="10dp"
        android:layout_toRightOf="@+id/Submitbtn"
        android:text="Cancel" />
   </RelativeLayout>

     </LinearLayout>
Ahmad Dwaik 'Warlock'

RatingBar needs a static width and you don't have it, as it wont autmatically adjust its star size, so find it a space and instead of

<RatingBar
        android:id="@+id/ratingBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:numStars="5"
        android:stepSize="1"
        android:rating="0" />

you need

<RatingBar
        android:id="@+id/ratingBar"
        android:layout_width="150dp" <!-- or whatever static size that fits-->
        android:layout_height="wrap_content"
        android:numStars="5"
        android:stepSize="1"
        android:rating="0" />

--EDIT--
If you want to make it smaller but not as much as @nurisezgin answer you could style your RatingBar but you will also need the static width, another solution if you are using that layout in dialog you could set the minimum width of that dialog,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:orientation="vertical"
 android:minWidth="300dp"
 android:padding="10dp" > // also use dp for padding instead of sp

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

How to fill the first two stars in font awesome star rating?

来自分类Dev

如何使用Awesome字体代替jQuery Rating Star中的图像

来自分类Dev

jQuery Star Rating插件变量未正确返回

来自分类Dev

Concatenate all the notes in a single row based on lead's ID?

来自分类Dev

Rails 5 Star Rating jQuery Plugin Raty 没有通过评级值

来自分类Dev

Android Rating Bar布局权重属性无法正常运行

来自分类Dev

Oracle show columns as row

来自分类Dev

When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5

来自分类Dev

order all row according to contents of a row

来自分类Dev

How to do a progress bar to show progress download of a big file with AndroidAnnotations?

来自分类Dev

Open UIViewController, don't show UINavigationController navigation bar

来自分类Dev

How to create a bar chart with floating bars to show time ranges?

来自分类Dev

暂停执行NETSH WLAN SHOW ALL命令

来自分类Dev

Yii2 Hide Actions in Action Column of a Single Row only

来自分类Dev

PostgreSQL single query SELECT single row FROM two tables without JOIN

来自分类Dev

子查询结果 'Single Row Sub-Query results more than One Row'

来自分类Dev

How to map all requests to single controller method in spring?

来自分类Dev

熊猫的高效STAR选择

来自分类Dev

Snakemake 和 STAR

来自分类Dev

How can I show the size of all files in my ~/.cache directory?

来自分类Dev

how to show opened file's path in the title bar of sublime text2?

来自分类Dev

How can I get Safari 4 on OS X to always show the tab bar?

来自分类Dev

无法将NULL插入(“ STUDENT”。“ RATING”。“ RATING_AGENCY_ID”)

来自分类Dev

Set minimum rating for bonds in R

来自分类Dev

更改PrimeFaces p:rating的图标?

来自分类Dev

R: Make all row values NA if one value is NA

来自分类Dev

MySQL query to return all row with same value only if all of them with equal to diffrent value

来自分类Dev

从Angular UI Rating Directive获取点击价值

来自分类Dev

如何使用vuetify v-rating事件?

Related 相关文章

  1. 1

    How to fill the first two stars in font awesome star rating?

  2. 2

    如何使用Awesome字体代替jQuery Rating Star中的图像

  3. 3

    jQuery Star Rating插件变量未正确返回

  4. 4

    Concatenate all the notes in a single row based on lead's ID?

  5. 5

    Rails 5 Star Rating jQuery Plugin Raty 没有通过评级值

  6. 6

    Android Rating Bar布局权重属性无法正常运行

  7. 7

    Oracle show columns as row

  8. 8

    When I use custom stars for Android RatingBar, always show half star for decimal values below 0.5

  9. 9

    order all row according to contents of a row

  10. 10

    How to do a progress bar to show progress download of a big file with AndroidAnnotations?

  11. 11

    Open UIViewController, don't show UINavigationController navigation bar

  12. 12

    How to create a bar chart with floating bars to show time ranges?

  13. 13

    暂停执行NETSH WLAN SHOW ALL命令

  14. 14

    Yii2 Hide Actions in Action Column of a Single Row only

  15. 15

    PostgreSQL single query SELECT single row FROM two tables without JOIN

  16. 16

    子查询结果 'Single Row Sub-Query results more than One Row'

  17. 17

    How to map all requests to single controller method in spring?

  18. 18

    熊猫的高效STAR选择

  19. 19

    Snakemake 和 STAR

  20. 20

    How can I show the size of all files in my ~/.cache directory?

  21. 21

    how to show opened file's path in the title bar of sublime text2?

  22. 22

    How can I get Safari 4 on OS X to always show the tab bar?

  23. 23

    无法将NULL插入(“ STUDENT”。“ RATING”。“ RATING_AGENCY_ID”)

  24. 24

    Set minimum rating for bonds in R

  25. 25

    更改PrimeFaces p:rating的图标?

  26. 26

    R: Make all row values NA if one value is NA

  27. 27

    MySQL query to return all row with same value only if all of them with equal to diffrent value

  28. 28

    从Angular UI Rating Directive获取点击价值

  29. 29

    如何使用vuetify v-rating事件?

热门标签

归档