
我的List_item.xml:
<?xml version="1.0" enCoding="utf-8"?><relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID" xmlns:tools="http://schemas.androID.com/tools" androID:ID="@+ID/scope_layout" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:background="@drawable/bg_scope_state_normal" androID:clickable="true" androID:focusable="true" androID:padding="8dp" androID:paddingStart="16dp" androID:paddingEnd="16dp" androID:layout_marginStart="6dp" androID:layout_marginEnd="6dp"> <TextVIEw androID:ID="@+ID/scope_text" androID:layout_centerInParent="true" androID:background="?attr/selectableItemBackground" androID:layout_wIDth="wrap_content" androID:layout_height="wrap_content" androID:textSize="16sp" tools:text="2/2017"/></relativeLayout>
现在,这是使用此代码在samsung s3上的外观:
如果我将List_item.xml中相对布局的宽度更改为80dp,这就是它的样子:
现在,正如你可以看到文本有不同的宽度和固定的宽度我在长字中缺少字母,wrap_content应根据文本视图宽度设置宽度,但在samsungs这不起作用,它只是拉伸布局我错过了什么吗?
解决方法 您可以在注释中删除Eugen所说的包装relativeLayout,并使用recyclelervIEw的内部系统 ItemDecorator代替绘制漂亮的背景.这应该修复你的用户界面
此外,您可以使用Android Monitor转储视图层次结构,并查看S3的实际值
总结以上是内存溢出为你收集整理的android – Horizontal RecyclerView wrap_content在samsungs上运行不正常?全部内容,希望文章能够帮你解决android – Horizontal RecyclerView wrap_content在samsungs上运行不正常?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)