android开发怎么把线性布局改为相对布局?

【Main.axml】代码:<?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://... 【Main.axml】代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:id="@+id/myButton"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
</LinearLayout>
【MainActivity】代码:

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

namespace c9
{
[Activity (Label = "c9", MainLauncher = true)]
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);

// Get our button from the layout resource,
// and attach an event to it
Button button = FindViewById<Button> (Resource.Id.myButton);

button.Click += delegate {
button.Text = string.Format ("{0} clicks!", count++);
};
}
}
}
展开
 我来答
乐观微微笑
2013-10-05
知道答主
回答量:5
采纳率:0%
帮助的人:7011
展开全部
<LinearLayout></LinearLayout>改为<RelativeLayout></RelativeLayout>

或者用你的eclisp,从新生成一个布局文件
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式