如何获得2张图片连接2布局钮 [英] how to get 2 images attached 2 layout botton

查看:134
本文介绍了如何获得2张图片连接2布局钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要附上两张图片 1日在左下角和其他在右下角 但我想,图像是铁杆的底部,所以,如果我滚动页面的图像应保持在同一个地方 谢谢

I want to attach 2 images 1st at left bottom corner and other on right bottom corner but i want that images to be hardcore in bottom so that if i scroll the page the images should remain at the same place Thanks

推荐答案

动态,我是成功的回答我的问题,以便即时通讯特此把code为所有的用户和它的作品等有code并享受

Dynamically ,i am succesful to answer my own question so i m hereby putting the code for all the user and it works so have the code and enjoy

            LinearLayout llMain=new LinearLayout(this);
        llMain.setOrientation(LinearLayout.VERTICAL);
        llMain.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT));
        llMain.setBackgroundColor(Color.WHITE);

        LinearLayout llLsView=new LinearLayout(this);
        llLsView.setOrientation(LinearLayout.VERTICAL);
        llLsView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT,1.0F));
        //llLsView.setPadding(0,0,0,20);



        LinearLayout llImage=new LinearLayout(this);
        llImage.setOrientation(LinearLayout.HORIZONTAL);
        llImage.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
        llImage.setBackgroundColor(Color.BLACK);

        LinearLayout llHome=new LinearLayout(this);
        //llHome.setOrientation(LinearLayout.HORIZONTAL);
        llHome.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT,0.5F));
        llHome.setPadding(0,0,5,0);
        llHome.setGravity(Gravity.RIGHT);

        ImageView imgHome=new ImageView(this);
        imgHome.setImageResource(R.drawable.home);
        llHome.addView(imgHome);

        LinearLayout llBack=new LinearLayout(this);
        //llBack.setOrientation(LinearLayout.HORIZONTAL);
        llBack.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.FILL_PARENT,0.5F));
        llBack.setPadding(5,0,0,0);
        llBack.setGravity(Gravity.LEFT);

        ImageView imgBack=new ImageView(this);
        imgBack.setImageResource(R.drawable.back);
        llBack.addView(imgBack);

        llImage.addView(llBack);
        llImage.addView(llHome);

        llMain.addView(llLsView);
        llMain.addView(llImage);

        setContentView(llMain); 

这篇关于如何获得2张图片连接2布局钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆