WEB开发网
开发学院手机开发Android 开发 Android 五种布局模式 阅读

Android 五种布局模式

 2013-03-13 19:00:05 来源:WEB开发网   
核心提示:android:layout_height="wrap_content" android:id="@+id/tvPassword" android:layout_y="10dip" android:layout_x="120dip">
android:layout_height="wrap_content"
android:id="@+id/tvPassword"
android:layout_y="10dip"
android:layout_x="120dip">
</EditText>
<EditText
android:layout_width="150px"
android:layout_height="wrap_content"
android:id="@+id/tvPassword"
android:layout_y="90dip"
android:layout_x="120dip">
</EditText>
</AbsoluteLayout>


package com.jay.Layout;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MyLayout extends Activity {
/** Called when the activity is first created. */
private Button btnLinearlayout;

private Button btnTablayout;

private Button btnRelativelayout;

private Button btnFramelayout;

private Button btnAbsolutelayout;

OnClickListener listener;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
CreateControl();

listener = new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.btnlinearlayout:
setTitle("线性布局");
setContentView(R.layout.linearlayout);
break;
case R.id.btntableayout:
setTitle("表格布局");
setContentView(R.layout.tablelayout);
break;
case R.id.btnrelativelayout:
setTitle("相对布局");
setContentView(R.layout.relativelayout);
break;
case R.id.btnfreamelayout:
setTitle("单帧布局");
setContentView(R.layout.framelayout);

上一页  3 4 5 6 7 8 9  下一页

Tags:Android 布局 模式

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接