布局问题 我用xml来布局的应该可以实现的 但动态生成按钮 不知道怎么做?
解决方案 »
- 安卓数据库操作,出了点小问题,在比较从数据库中读到的数据与输入的数据的时候出了问题,好心人帮忙改一下吧?
- android 如何读取同学录中的数据
- 我用myEclipse6.0按装插件ADT怎么不行?提示错误信息如下:
- Android引用googleMapAPI是出现的问题
- 手机开发协议
- Android应用程序无法运行
- 两台手机安装同一APP,如何在两个APP之间进行数据接收和发送?
- 【菜鸟】run起项目后虚拟机一直处于黑屏和只出现android字样是什么回事?
- 求助一下大神,关于C#开发android和java开发的区别
- 寻找思路,指点一下别人这效果怎么实现的
- 在用ScrollView嵌套了listView或者GridView后滚动条没显示了
- android 文字合成声音
RelativeLayout rootLayout = (RelativeLayout)findViewById(R.id.rootLayout);
Button btnOK = new Button(this);
btnOK.setText("OK");
rootLayout.addView(btnOK);
layout文件:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/rootLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" /></RelativeLayout>