简体   繁体   English

使用哪个工具或视图来创建此布局

[英]Which tool or view is used to create this layout

这是日历布局

The blue rectangle in which test is written, how it is covering ,one full and some portion of lower and upper cell?, ,,, how these cells are made? 写入测试的蓝色矩形,它是如何覆盖的,下部和上部单元的一部分和一部分?,,,这些单元是如何制作的? , this isnt a simple grid. ,这不是一个简单的网格。 consider this ,what this layout contains, how blue rectangle can cover a specified area.? 考虑一下,这个布局包含什么,蓝色矩形如何覆盖指定区域。 help out 帮忙

This is probably a custom view. 这可能是一个自定义视图。

The background texture is a Bitmap , the cells are line drawn on a canvas and the blue area with text is a drawn rectangle. 背景纹理是位图,单元格在画布上绘制线条,带文本的蓝色区域是绘制的矩形。

When you create the view , you know oh many pixel represent an hour , so you should be able to give an exact position to the rectangle. 创建视图时,您知道许多像素代表一小时,因此您应该能够为矩形提供精确的位置。

At least it's how i would do it. 至少我是这样做的。

You should have look at Creating Custom Views in android resources and more specificaly read Custom Drawing 你应该看看在android资源中创建自定义视图 ,更具体地说是阅读自定义绘图

To create such view you can: 要创建此类视图,您可以:

  1. create your custom view and draw on its canvas 创建自定义视图并在其画布上绘制
  2. use GridLayout that's available as a support library for android 2.1 使用GridLayout作为android 2.1的支持库

I suggest to use the second variant. 我建议使用第二种变体。

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

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