解决方案 »

  1.   

    如果你用的线性布局,是可以不要这个的 android:layout_alignParentLeft="true"
      

  2.   

      <RelativeLayout
            android:id="@+id/handle_btnlayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >        <Button
                android:id="@+id/previous_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="@drawable/before" />
            <Button
                android:id="@+id/play_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
              
                android:background="@drawable/play" />         <Button
                android:id="@+id/next_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:background="@drawable/next" />
        </RelativeLayout>
      

  3.   

      <Button
                android:id="@+id/play_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
              
                android:background="@drawable/play" />这个button没有定位,必定无法显示。
      

  4.   

    前一个被后一个挡住了。
    1.使用线性布局
    2.使用偏移   paddingLeft
    3.第二个buton可以 android:layout_alignParentRight="true"
      

  5.   

    方法1:<RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
    <Button
                android:id="@+id/previous_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="@drawable/before" />
            <Button
                android:id="@+id/play_music"
               <!--  注意这句-->
                android:layout_toRightOf="@+id//previous_music" 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
              
                android:background="@drawable/play" /></RelativeLayout>
      

  6.   

    方法2:
    <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
    <Button
                android:id="@+id/previous_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:background="@drawable/before" />
            <Button
                android:id="@+id/play_music"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:background="@drawable/play" /></LinearLayout> 
    PS:
      上一个RelativeLayout 少了>
      

  7.   

    LinearLayout 或者 RelativeLayout 出现只有最后一个 按钮的原因可能是 : 
    RelativeLayout 没有设置相对位置
    FrameLayout 直接覆盖了