解决方案 »
- 【书籍】求多线程编程和网络编程方面的书籍推荐
- ViewGroup使用Adapter
- 关于APK的问题
- 求Android插件ADT
- 求一andriod入门书籍
- android平台上,是否可以连接远程sqlserver2008
- android 占用CPU问题
- 今天写博格,文章中无法插入CODE代码片了,怎么回事?
- dialog中转到Activity, Activity结束之后如何通知dialog刷新界面?startActivityForResult?
- java后台怎么保存Android端用户登录状态
- 关于su权限切换命令的问题
- 前端(Android、IOS)APP应用与后端服务(比如Web Service)进行交互,比如就是普通的请求和返回Json.
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>
android:id="@+id/play_music"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:background="@drawable/play" />这个button没有定位,必定无法显示。
1.使用线性布局
2.使用偏移 paddingLeft
3.第二个buton可以 android:layout_alignParentRight="true"
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>
<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 少了>
RelativeLayout 没有设置相对位置
FrameLayout 直接覆盖了