首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

上边图片和下面文字布局(命令)

2012-07-02 
上面图片和下面文字布局(命令)LinearLayout layout new LinearLayout(this)layout.setOrientation(Line

上面图片和下面文字布局(命令)
     LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.VERTICAL);
        LinearLayout.LayoutParams param =
        new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        ImageView image = new ImageView(this);
        image.setBackgroundResource(R.drawable .icon);
        layout.addView(image, param);
        TextView  text;
        text = new TextView(this);
        text.setText("textview");
        layout.addView(text, param);
        setContentView(layout);   

热点排行