首页 > 其他 > 详细

BullsEye游戏优化布局

时间:2019-12-07 21:50:19      阅读:133      评论:0      收藏:0      [点我收藏+]

横屏展示与不展示Bar实现:

技术分享图片

 

布局优化目标:设备适应  样式优化

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_weight="1"
android:background="#ff0000"
android:gravity="center">
<TextView
android:id="@+id/tv_target"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="小样把进度条拖到:100"
android:textColor="@color/white"
android:textSize="20dp"/>
</LinearLayout>
<LinearLayout
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_weight="1"
android:orientation="vertical"
android:background="#00ff00">
<SeekBar
android:id="@+id/sb_bulsseye"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:max="100"
android:progress="0"/>
<Button
android:id="@+id/btn_ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="搞定"
android:layout_gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_height="0dp"
android:layout_width="match_parent"
android:layout_weight="1"
android:background="#ff00ff">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#ff00ff"
android:orientation="horizontal"
android:gravity="center">
<Button
android:id="@+id/btn_replay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="重新开始" />
<TextView
android:id="@+id/tv_source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="分数:0"
android:textColor="@color/white"
android:layout_margin="6dp"/>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#0000ff"
android:orientation="horizontal"
android:gravity="center">
<Button
android:id="@+id/btn_help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="帮助" />
<TextView
android:id="@+id/tv_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="局数:1"
android:textColor="@color/white"
android:layout_margin="6dp"/>
</LinearLayout>
</LinearLayout>
<!-- <TextView-->
<!-- android:id="@+id/tv_target"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="小样把进度条拖到:100" />-->

<!-- <SeekBar-->
<!-- android:id="@+id/sb_bulsseye"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:max="100"-->
<!-- android:progress="0"/>-->

<!-- <Button-->
<!-- android:id="@+id/btn_help"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="帮助" />-->

<!-- <Button-->
<!-- android:id="@+id/btn_ok"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="搞定" />-->

<!-- <Button-->
<!-- android:id="@+id/btn_replay"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="重新开始" />-->

<!-- <TextView-->
<!-- android:id="@+id/tv_source"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="分数:0" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_index"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="局数:1" />-->
</LinearLayout>

效果展示:

技术分享图片

 

 

 

BullsEye游戏优化布局

原文:https://www.cnblogs.com/cxj1821/p/12003398.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!