gpt4 book ai didi

android - ExpandableCardView 文本不完全可见

转载 作者:行者123 更新时间:2023-11-29 23:46:28 25 4
gpt4 key购买 nike

我正在使用 this library实现可扩展卡,它工作正常,除了两个主要问题,即:

  1. 它要求最低 api 级别为 21,而之前我的最低 api 级别为 16。这在低端设备上是否运行良好。在库的 list 文件中有一个选项可以覆盖它,但我认为这不是一个好主意。

  2. 我的布局如下所示,其中包含另一个带有 TextView 的布局,但文本未完全显示,只有第一行可见。这是布局:

         <com.alespero.expandablecardview.ExpandableCardView
    android:id="@+id/focusCardLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/metaCard"
    android:layout_marginBottom="10dp"
    app:expandOnClick="true"
    app:inner_view="@layout/session_inner_card_focus_pts_layout"
    app:title="Focus Points" />

inner_view 布局:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/focusPointsTV"
android:layout_margin="5dp"
android:layout_marginBottom="10dp"
android:text="You cannot win matches without scoring points so it's important your players can shoot accurately."
android:textSize="18sp"
android:padding="10dp">

</TextView>

这是我的布局错误还是库错误。我已经将input_type设置为短/长消息,仍然没有效果。expanding-collapsing cardviews android 还有其他方法吗?谢谢。

最佳答案

我试过你的代码,我认为你的问题来自图书馆。

我也知道一个可以解决您问题的库,即 this library

<!-- sample xml -->
<com.ms.square.android.expandabletextview.ExpandableTextView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
android:id="@+id/expand_text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
expandableTextView:maxCollapsedLines="4"
expandableTextView:animDuration="200">
<TextView
android:id="@id/expandable_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:textSize="16sp"
android:textColor="#666666" />
<ImageButton
android:id="@id/expand_collapse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="16dp"
android:layout_gravity="right|bottom"
android:background="@android:color/transparent"/>
</com.ms.square.android.expandabletextview.ExpandableTextView>

它对我有用,我希望它对你也有帮助。

关于android - ExpandableCardView 文本不完全可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51317702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com