您的位置:首页 > 产品设计 > UI/UE

自己项目中做的UI布局

2015-12-11 17:44 381 查看
一丶先看效果图

这个项目本来要求是背景要透明的,但是这点还没有处理还,先做好,在修改



GetGoldActivity

package com.imnet.shouyoufanli.activity;

import com.imnet.shouyoufanli.R;

import android.app.Activity;
import android.os.Bundle;

/**
* @author Administrator
* 怎么样获得金币界面
*/
public class GetGoldActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

initView();
}

/**
* 初始化控件
*/
private void initView() {
setContentView(R.layout.activity_howtogetgold);
}
}


activity_howtogetgold.xml
<?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:background="#00000000"
android:orientation="vertical" >

<LinearLayout
android:layout_width="240dp"
android:layout_height="300dp"
android:layout_marginLeft="40dp"
android:layout_marginTop="60dp"
android:background="#ffffff"
android:orientation="vertical" >

<TextView
android:id="@+id/tv_howtogetgold_getgold"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#009900"
android:paddingBottom="7dp"
android:paddingTop="7dp"
android:text=" 怎样获得金币? "
android:textColor="#ffffff"
android:textSize="20sp" />

<!-- 金币 -->

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp" >

<TextView
android:id="@+id/tv_howtogetgold_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/number_circle"
android:text="1"
android:textColor="#ffffff"
android:textSize="12sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/tv_howtogetgold_1"
android:text="金币 : 通过游戏充值获得;您在快\n返体验游戏并充值,系统将返利以\n金币形式自动发送至快返帐号;"
android:textColor="#000000"
android:textSize="12sp" />
</RelativeLayout>

<!-- 绑定金币 -->

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="6dp" >

<TextView
android:id="@+id/tv_howtogetgold_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/number_circle"
android:text="2"
android:textColor="#ffffff"
android:textSize="12sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/tv_howtogetgold_2"
android:text="绑定金币 : 简称绑金,通过邀请好\n友体验快返,好友充值游戏,则您\n可按比例获得绑定奖励;"
android:textColor="#000000"
android:textSize="12sp" />
</RelativeLayout>

<!-- 金币和绑定金币 -->

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="6dp" >

<TextView
android:id="@+id/tv_howtogetgold_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/number_circle"
android:text="3"
android:textColor="#ffffff"
android:textSize="12sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/tv_howtogetgold_3"
android:text="金币和绑定金币 : 可通过商城界面\n兑换成平台币,平台币等同于现金\n使用,可再次充值进游戏;"
android:textColor="#000000"
android:textSize="12sp" />
</RelativeLayout>

<!-- 金币和绑定金币 -->

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="6dp" >

<TextView
android:id="@+id/tv_howtogetgold_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:background="@drawable/number_circle"
android:text="4"
android:textColor="#ffffff"
android:textSize="12sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@id/tv_howtogetgold_4"
android:text="金币和绑定金币,也可用来兑换游\n戏礼包;"
android:textColor="#000000"
android:textSize="12sp" />
</RelativeLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:orientation="horizontal" >

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="导航 :"
android:textColor="#000000"
android:textSize="12sp" />

<TextView
android:id="@+id/tv_howtogetgold_intentfriend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="@string/intentfriend"
android:textColor="#ff0000"
android:textSize="12sp" />

<TextView
android:id="@+id/tv_howtogetgold_store"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="@string/store"
android:textColor="#ff0000"
android:textSize="12sp" />

<TextView
android:id="@+id/tv_howtogetgold_giftbag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:text="@string/giftbag"
android:textColor="#ff0000"
android:textSize="12sp" />
</LinearLayout>

<TextView
<span style="white-space:pre">android:id="@+id/tv_howtogetgold_iknow"</span>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="7dp"
android:background="#009900"
android:paddingBottom="3dp"
android:paddingTop="3dp"
android:text="     我知道了     "
android:textColor="#ffffff"
android:textSize="20sp" />
</LinearLayout>

</LinearLayout>


drawable目录下的小圆圈 
number_circle.xml

<?xml ve
4000
rsion="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >

<!-- 填充的颜色 -->
<solid android:color="#009900" />

<!-- 边距 -->
<padding
android:left="3dp"
android:right="3dp" />

</shape>

values目录下的 strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">ShouYouFanli</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="clause"><u>《快返手游返利平台服务条款》</u></string>
<string name="reginnewcounts"><u>注册新帐号>></u></string>
<string name="intentfriend"><u>邀请好友 </u></string>
<string name="store"><u>商城 </u></string>
<string name="giftbag"><u>礼包 </u></string>

</resources>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: