The Issue is:
让我们说用户在SD卡中有100个文件,要在布局中显示我需要添加前100个视图,然后我会做样式.错误的做法
My Question is:
可以通过progamatically或通过XML做什么,以便我只能定义五个基本视图,并根据SD卡中的图像数量,它创建剩余的布局和视图,以便我可以通过水平滚动视图访问它们.
My research includes:
我尝试使用网格视图布局,但它没有完全满足我的需求,因为它具有所有网格的统一大小.更多我知道如何以编程方式添加布局,但我不知道如何使它与我的设计一起工作.
解决方法@H_301_29@ 你可以通过改变你的xml两侧可滚动来实现 –<horizontalscrollview xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:layout_wIDth="320px" androID:layout_height="fill_parent"> <tableLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" androID:ID="@+ID/linlay" androID:layout_wIDth="320px" androID:layout_height="fill_parent" androID:stretchColumns="1" androID:background="#000000"/></horizontalscrollview>总结
以上是内存溢出为你收集整理的以编程方式添加布局android全部内容,希望文章能够帮你解决以编程方式添加布局android所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)