吹乱的思绪 2015-12-02 10:29 采纳率: 0%
浏览 24556

RecyclerView的item显示出现控件显示不全

item中是一个复杂布局,其中的TextView的显示高度不对。
android:id="@+id/body"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/title"
android:weightSum="11">

    <RelativeLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="7"
        android:paddingBottom="10dp">

        <TextView
            android:id="@+id/tvQuestion"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="10dp"
            android:text="aslkjdkjhdaksjdhk立刻决定是否莱克斯顿螺丝钉看法上的浪费苏打绿分里是空的将速度;是副食店了解分i未记录河流啊哈我阿拉维uifhlieawh分i芦苇 哇额uifha"
            android:textColor="@color/color_text_very_hard"
            android:textSize="20sp"
            />

        <TextView
            android:id="@+id/tv_question"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="10dp"
            android:text="显示问题的检查项两节课第三方乐山大佛蓝色的开始的;史蒂文哦i额;哦恶化;偶发;W 3哦()*&amp;()*&amp;哦额我饿r9p8w4r  "
            android:textColor="@color/color_text_very_light"
            android:textSize="18sp"
            android:layout_below="@+id/tvQuestion"
            />

    </RelativeLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_weight="3"
        android:orientation="horizontal">

        <info.hoang8f.android.segmented.SegmentedGroup
            android:id="@+id/ans_group"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:gravity="center_vertical|center_horizontal"
            android:orientation="horizontal"
            android:paddingBottom="10dp"
            android:paddingTop="10dp"
            segmentedgroup:sc_border_color="@color/color_answer_border"
            segmentedgroup:sc_border_width="1dp"
            segmentedgroup:sc_corner_radius="5dp"
            segmentedgroup:sc_no_comment_color="@color/color_answer_ignore"
            segmentedgroup:sc_text_color="@color/color_answer_text"
            segmentedgroup:sc_tint_color="@color/color_answer_pass"
            segmentedgroup:sc_unqualified_color="@color/color_answer_fail">

            <RadioButton
                android:id="@+id/ans_yes"
                style="@style/RadioButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="1"
                android:textSize="20sp"/>

            <RadioButton
                android:id="@+id/ans_no"
                style="@style/RadioButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="2"
                android:textSize="20sp"/>

            <RadioButton
                android:id="@+id/ans_never"
                style="@style/RadioButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="3"
                android:textSize="20sp"/>

        </info.hoang8f.android.segmented.SegmentedGroup>
    </LinearLayout>

</LinearLayout>

出现显示不全的view就是id为tvQuestion和tv_question

  • 写回答

4条回答 默认 最新

  • pop1234o 2016-07-22 08:58
    关注

    在adapter中的onCreateViewHolder()中
    View inflate = layoutInflater.inflate(R.layout.xxx, parent, false); 注意要依附于parent

    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大