2015-04-10 6 views
1

Как это сделать? Выше изображено изображение, ниже - коробка testo. Между ними проблема, 3 кнопки и 1 панель прогресса.Как я могу сделать этот макет 3 imagebutton 1 progressbar?

Как это изображение:

+0

я не вижу здесь проблемы. Это очень просто. Игра LinearLayouts, если вы новичок. Я бы посоветовал вам разобраться в себе. – rafid059

ответ

0

Здесь это код: вы просто меняете Button на ImageButton и используете кнопку изображения по вашему выбору

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

    <ImageView 
     android:id="@+id/imageView1" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_launcher" 
     android:layout_weight=".8"/> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_weight="1.3" > 

     <Button 
      android:id="@+id/button1" 
      style="?android:attr/buttonStyleSmall" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Play" 
      android:layout_gravity="center" /> 

     <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical" 
      android:gravity="center" > 

      <ProgressBar 
       android:id="@+id/progressBar1" 
       style="?android:attr/progressBarStyleHorizontal" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="10dp" 
       android:layout_marginRight="10dp" 
       /> 

      <LinearLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_gravity="right" 
       android:gravity="right" > 

       <Button 
        android:id="@+id/button2" 
        style="?android:attr/buttonStyleSmall" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:gravity="right" 
        android:text="Stop" /> 

       <Button 
        android:id="@+id/button3" 
        style="?android:attr/buttonStyleSmall" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:gravity="right" 
        android:text="Pause" /> 

      </LinearLayout> 

     </LinearLayout> 

    </LinearLayout> 

    <LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:layout_weight=".8" 
     android:gravity="center" > 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Enter Your Text" 
      android:laout_gravity="center" 
      android:textAppearance="?android:attr/textAppearanceLarge" /> 

    </LinearLayout> 

</LinearLayout> 

В следующий раз попробуйте сами ....

0

Одним из возможных решений, пожалуйста, добавьте все обязательными для заполнения атрибутов (только псевдо наценки):

enter image description here

<LinearLayout 
    orientation="vertical"> 

       <ImageView/> 

       <LinearLayout 
       orientation="horizontal"> 
        <Button/> 
        <LinearLayout 
        orientation="verical"> 
         <ScrollBar/> 
         <LinearLayout 
         orientation="horizontal" 
         gravity="right"> 
            <Button/> 
            <Button/> 
         </LinearLayout> 
       </LinearLayout> 
      </LinearLayout> 

      <TextView/> 
    </LinearLayout> 
Смежные вопросы