自己项目中做的UI布局

一丶先看效果图

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


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 version="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>






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值