2016-03-26 40 views

回答

0

創建的RatingBar使用XML低於

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

現在爲Multiline TextView使用了這個;

<TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:inputType="textMultiLine"/> 

設置屬性android:inputType = "textMultiLine"它將允許多行文本。

0

檢查thisthis

詳細簡要

可以使用的LinearLayout/RelativeLayout的/ FrameLayout裏/ TableLayout來顯示不同的控件。

的LinearLayout - 正如名字建議你會把控制在直線導軌(水平/垂直)

//你可以豎置的控制或水平

<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="play" 
    /> 

RelativeLayout - 添加控件相對於其他

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" android:layout_width="match_parent" 
    android:layout_height="80dp" 
    android:background="#bbbbff"> 

    <RatingBar 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/progressBar" 
     android:layout_alignParentBottom="true" 
     android:layout_toLeftOf="@+id/playButton"/> rating bar is in bottom in parent and to left of your button 

    <Button 
     android:layout_width="60dp" 
     android:layout_height="60dp" 
     android:text="play" 
     android:layout_alignParentRight="true" // button will be right side in parent view 
     android:id="@+id/playButton"/> 
</RelativeLayout> 

請通過鏈接瞭解更多詳情。希望這會有所幫助。

相關問題