android - 评级栏不在单行中显示全明星

标签 android

我的评分栏在单行中不完全对齐参见图片 http://imgur.com/vRGrXU1最后一颗星不会完全显示我将如何解决这个问题请帮助我如何解决这个问题以显示所有 5 星评级栏完全帮助我

           <?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>

最佳答案

试试这个-

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

这会减小 RatingBar 的宽度。

你也可以使用样式-

see this link.

关于android - 评级栏不在单行中显示全明星,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19297337/

相关文章:

java - 安卓 native : cannot allocate large memory under native layer

c# - 在c#中使用后端的跨平台聊天应用程序的方法

android - 如何找到 GC_FOR_MALLOC 的来源?

java - 如何在java中的sqlite db中获取并自动输入当前日期?

android - 当我想在 java servlet 中访问他时,从 android 应用程序发送的 JSON 对象为空

android - 为 Android > 4.0 Webkit 的焦点禁用文本输入的矩形(橙色边框)

android - 简单的 Android BLE 扫描仪

android - 如何使用 URL 处理多个微调器?

javascript - 在网站中检测 android 混合应用程序环境

android - 不均匀的 LinearLayout 权重分布