自定义视图和视图组
我已经创建了自己的视图和视图组。 ViewGroup 是一个包含动态TableView 的LinearLayout。我添加了两行,但只显示了一行。第一行采用完整高度。
运行时的目标是这样的输出:
但我需要这个:
完美的是,单元格是方形的,底部未使用。 像这样:
我已经上传了风格化的 代码
我希望有人可以帮助我。
抱歉,我无法直接包含图像,因为:“我们很抱歉,但作为垃圾邮件预防机制,不允许新用户发布图像。发布图像需要获得超过 10 个声誉。”
我将图像 URL 包含为文本,因为:“我们很抱歉,但作为垃圾邮件预防机制,新用户最多只能发布两个超链接。获得超过 10 个声誉才能发布更多超链接。”
谢谢
i have create my own View and ViewGroup. The ViewGroup is a LinearLayout that includes a dynamic TableView. I add two rows, but only one is displayed. The first Row take the full height.
The Destination on Run is this Output:
But i need this:
Perfectly, the cells are square and the Bottom is unused.
Like this:
I have uploaded the stylized code
I hope someone can help me.
Sry, i cant include the images directly because: "We're sorry, but as a spam prevention mechanism, new users aren't allowed to post images. Earn more than 10 reputation to post images."
And the image Urls i have included as text because: "We're sorry, but as a spam prevention mechanism, new users can only post a maximum of two hyperlinks. Earn more than 10 reputation to post more hyperlinks."
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道更多关于通过代码创建表的信息,但我在从 XMl 文件创建表时也遇到同样的问题。当时我通过使用线性布局的高度宽度和填充父选项解决了这个问题。
或者你可以使用相对布局而不是线性布局并尝试一下。也许它对你有帮助。
I dont know more about creating table by code but same problem i feel while creating the table from XMl file. In that time i have solved the problem by using height-width of linear layout with fill parent option.
Or U can Use Relative Layout instead of the Linear Layout and try it. May be it helps u.
尝试以这种方式设置权重。
Try setting the weights this way.