How to get the size marked in red in order to assign them to the Header which is marked in green when displayed?
It is necessary that the Header text is green blocks with the same width as the red ones. As in Excel spreadsheet or SQL.
How to get the size marked in red in order to assign them to the Header which is marked in green when displayed?
It is necessary that the Header text is green blocks with the same width as the red ones. As in Excel spreadsheet or SQL.
Summarize the comments:
You do not need to get the size of the red blocks and set them programmatically green blocks. You need to set the same size (width) for the red and green blocks in the markup (xml). Either through shares (weights in LinearLayout), or directly in dp .
Regarding the correctness of the indication of the size of the numbers ... I do not know where you heard such nonsense that it is bad, although perhaps you pulled this statement out of the context in which it made sense. Poorly indicate the size of the numbers where logically the size should depend on the content. It is bad to NOT specify the size in numbers where it should NOT depend on the content. The width of the columns should be specified either in fractions (weights) or in fixed figures, possibly different for several screen reference sizes. On my current project, for example, there is a table with the results of races; two markup is used there: portrait and landscape. And 4 sizes (dimensions) of columns: phone in portrait orientation, phone in landscape, tablets with a small screen (7-9 ") and tablets with a large screen (tablets only in landscape). This is quite enough for a normal appearance on all devices .
Source: https://ru.stackoverflow.com/questions/487498/
All Articles
wrap_contentfor columns to use. - xkorlayout_weightattribute. - xkor