简体   繁体   English

Android App小部件高级(?)布局

[英]Android App Widget advanced(?) layout

I'm new to android programming. 我是android编程的新手。 I would like to make an app widget that will display a set of contact images and allow me to call or send a text message of the person whose picture I press. 我想制作一个可显示一组联系人图像的应用程序小部件,并允许我致电或发送所按图片的人的短信。

If you notice the bottom widget in the image, there are two oversized pictures (top left and bottom right) that seem as if they could not fit into a linearlayout. 如果您注意到图像中的底部小部件,则有两张超大尺寸的图片(左上方和右下方)似乎无法容纳在线性布局中。

http://i.stack.imgur.com/H13i7.jpg http://i.stack.imgur.com/H13i7.jpg

How is this done, what I'm asking is which app widget layout would I use to align images as they are in the bottom widget on this screen? 这是如何完成的,我要问的是,我将使用哪种应用小部件布局来对齐图像,就像它们在屏幕底部的小部件中一样?

Edit: I'm new, but I have plenty of time to learn this, so I figure I'll press forward. 编辑:我是新手,但是我有很多时间来学习这个,所以我想我会继续前进。 I get the feeling I would be able to take images and combine them into a single master image with a whole lot of flexibility. 我感觉到我将能够拍摄图像并将它们组合成具有很大灵活性的单个主图像。

http://androidattop.blogspot.com/2012/06/merge-multiple-images-into-one-image-in.html http://androidattop.blogspot.com/2012/06/merge-multiple-images-into-one-image-in.html

Then I'd just have to figure out where on the image a user clicked. 然后,我只需要弄清楚用户单击图像的位置。 Or I could split only big images and use nested linearlayouts, which would save the custom click listener which looks like its more likely the way to go, but I worry about gaps in the larger images. 或者,我只能拆分大图像并使用嵌套的linearlayouts,这将节省自定义的点击侦听器,看起来更像是可行的方式,但是我担心较大的图像中的空白。

All advice/help is appreciated. 感谢所有建议/帮助。

How is this done 这是怎么做的

You would have to ask the authors of that app to determine how they did it. 您必须要求该应用程序的作者确定他们的操作方式。

what I'm asking is which app widget layout would I use to align images as they are in the bottom widget on this screen? 我要问的是,与该屏幕底部小部件中的图像一样,我将使用哪种应用程序小部件布局来对齐图像?

That could most easily be accomplished with a GridLayout I think, but that is only available on API Level 16+ for app widgets. 我认为,使用GridLayout最容易实现,但这仅在API级16+上适用于应用程序小部件。

Beyond that, use nested LinearLayouts . 除此之外,请使用嵌套的LinearLayouts For example, a horizontal LinearLayout holding onto three vertical LinearLayouts would provide the basic skeleton. 例如,水平LinearLayout保持到三个垂直LinearLayouts将提供的基本骨架。 Each of those three vertical LinearLayouts would hold a subset of your imagery. 这三个垂直LinearLayouts每一个都将保存图像的一个子集。 For example, the middle LinearLayout would be a column of the three images. 例如,中间的LinearLayout将是三个图像的一列。

That being said, if you are "new to android programming", I would recommend starting with a simpler project. 话虽如此,如果您“不熟悉android编程”,我建议您从一个简单的项目开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM