3.2 MonoForAndroid用户人机界面-更改手机窗口画面底色



Resources\layout\Main.axml

<?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/widget35"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/white">
    <TextView
        android:id="@+id/widget28"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/str_id"
        android:textColor="@drawable/darkgray"
        android:layout_x="61px"
        android:layout_y="69px" />
    <TextView
        android:id="@+id/widget29"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/str_pwd"
        android:textColor="@drawable/darkgray"
        android:layout_x="61px"
        android:layout_y="158px" />
    <EditText
        android:id="@+id/widget31"
        android:layout_width="120dip"
        android:layout_height="wrap_content"
        android:textSize="18sp"
        android:layout_x="114px"
        android:layout_y="57px" />
    <EditText
        android:id="@+id/widget30"
        android:layout_width="120dip"
        android:layout_height="wrap_content"
        android:textSize="18sp"
        android:password="true"
        android:layout_x="112px"
        android:layout_y="142px" />
</AbsoluteLayout>

Resources\values\Strings.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="Hello">Hello World, Click Me!</string>
    <string name="ApplicationName">Ex03_02</string>
    <string name="str_id">帐号</string>
    <string name="str_pwd">密码</string>
</resources>

Resources\values \color.xml

<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <drawable name="darkgray">#808080FF</drawable>
  <drawable name="white">#FFFFFFFF</drawable>
</resources>


MainActivity.cs

using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Ex03_02
{
    [Activity(Label = "Ex03_02", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        int count = 1;

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
        }
    }
}



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值