定制的LinearLayoutLinearLayout

由网友(相依相随)分享简介:我想要像以下布局:有关,我需要3个背景是这样的:我将需要结合所有这些,在运行时我不得不改变每一个背景颜色所以我想进行自定义的LinearLayout。 但我不知道如何使它这样。我已经检查使三角形和平行四边形布局的一些例子,但我也想合并所有三种观点。请给一些有用的链接,也给$ ​​C $ C的例子,而不是给引用。 感谢你...

我想要像以下布局:

有关,我需要3个背景是这样的:

我将需要结合所有这些,

在运行时我不得不改变每一个背景颜色

所以我想进行自定义的LinearLayout。

但我不知道如何使它这样。

我已经检查使三角形和平行四边形布局的一些例子,但我也想合并所有三种观点。请给一些有用的链接,也给$ ​​C $ C的例子,而不是给引用。

感谢你在前进。 :)

我试图在相对布局。对于远程视窗,我想这样的:

  Col​​orFilter CF =新PorterDuffColorFilter(-15032095,Mode.MULTIPLY);
        绘制对象D = context.getResources()getDrawable(R.drawable.panel1)。
        d.mutate();
        d.setColorFilter(CF);
 
U品木门 木门的搭配方法

我试过低于codeS:

  rv.setInt(R.id.rl_noti_main,setColorFilter,D);
rv.setInt(R.id.rl_noti_main,setBackgroundDrawable,-15032095);
rv.setInt(R.id.rl_noti_main,setBackgroundResources,D);
 

解决方案

尝试框架布局或相对布局。需要重叠视图来实现这一不能在线性布局来完成。使每个图像的矩形透明区域哪一部分需要重叠。

I want to make layout like following :

For that i will need three backgrounds like this:

I will need to combine all of them and

at runtime i have to change background color of each

so i thought to make custom linearlayout.

But I don't know how to make it like that.

I have checked some example of making triangular and parallelogram layout but i want to merge all three views also. Please give some useful links and also give code example rather than giving references.

Thank you in Advance. :)

I tried in relative layout. for remoteview, i tried this:

ColorFilter cf = new PorterDuffColorFilter(-15032095, Mode.MULTIPLY);
        Drawable d= context.getResources().getDrawable(R.drawable.panel1);
        d.mutate();
        d.setColorFilter(cf);

I tried below codes:

rv.setInt(R.id.rl_noti_main, "setColorFilter", d);
rv.setInt(R.id.rl_noti_main, "setBackgroundDrawable", -15032095);
rv.setInt(R.id.rl_noti_main, "setBackgroundResources",d);

解决方案

try frame layout or relative layout. you need to overlap each view to achieve this which can't be done in linear layout. make each image as rectangle with transparent area which part need to overlap.

阅读全文

相关推荐

最新文章