質問

I have a GenericStaticBlocksCellView inside a CategoryGridView for a custom category list. I followed this tutorial and added a few blocks to my row view. Now I have a text block holding the title, and an image block holding the row background.

For some reason, the text of the titles is still hidden. I can't see it.

役に立ちましたか?

解決

If you can't see your text blocks, you may have one of these potential problems:

  1. Make sure your background is behind the text. If your background image block is defined after your text block (ie. block 1 is the text, block 2 is the background), in case of overlap it will be drawn over it. What you can do it swap their order in this case. Always make sure the blocks you want in the front are the last ones.

  2. If you can't see your text block, make sure it's positioned properly. Try setting its width to 100%, height to 100%, left to 0%, top to 0%. This will make sure you see it and make it appear exactly in the middle of your row.

  3. Last problem, which is a bit crazy, but possible is this: If your background image is too big, it may exceed your row boundaries. By default, the block canvas is not clipping, meaning that content that jumps out, will be rendered outside your row. If your background image height is too big, bigger than your canvas height, it might be drawn outside and cover the titles of the next rows. The effect seen in this case is usually that titles only appear in some of the rows - and not all of them. To fix this, you can either make your background image a bit smaller, or make your row bigger. To change your row height, go to the CategoryGridView itself and find the WidthHeightRatio field. If you make this number bigger it will make your rows taller. For best result, the number there should be your background pixel height divided by your background pixel width.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top