2012-03-12 131 views
0

我需要的是具有相同的布局设计,因为这(第一张照片在此页)http://developer.android.com/resources/articles/speech-input.html应用程序..Android的布局中的布局设计

我不知道如何来实现这一任务..

在此先感谢.. =)

+0

你尝试过什么?您是否阅读过[this](http://developer.android.com/guide/topics/ui/layout-objects.html)文档? – kabuko 2012-03-12 18:52:38

+0

您是否熟悉android设计基础知识? – 2012-03-12 18:55:09

+0

@Kabuko先生我知道的差异btw的布局:) ..我没有彻底读它,但我知道它.. – Shah 2012-03-12 19:35:46

回答

0

可以使更多的帮助,请本使用自定义对话框custom dialog example

或根据太贵要求

这是你的主要XML

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/mainLayout" android:layout_width="fill_parent" 
android:layout_height="fill_parent" android:orientation="vertical"> 

</LinearLayout> 

和java文件是

package com.chirag; 

import android.app.Activity; 
import android.app.Dialog; 
import android.os.Bundle; 
import android.view.View; 
import android.view.View.OnClickListener; 


public class TestActivity extends Activity { 
/** Called when the activity is first created. */ 
@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 
    Dialog dialog = new Dialog(TestActivity.this); 
      dialog.setContentView(R.layout.dialog_layout); 
      dialog.setCancelable(true); 
      //there are a lot of settings, for dialog, check them all out! 


      //now that the dialog is set up, it's time to show it  
      dialog.show(); 
    } 
} 

我现在希望它为你工作...

+0

先生如果你的链接,我有张贴..布局下面没有按钮或什么..我想显示两个临当应用程序启动时开始的布局... – Shah 2012-03-12 20:13:41

+0

意味着您希望在应用程序启动时使用该对话框,以便您必须将背景图像设置为根布局,并直接在onCreate()方法中显示此对话框....因为没有AC你不能显示你的对话......我根据你的要求编辑了我的答案...... – 2012-03-13 01:37:36