【问题标题】:Android TextView Not Wraping up the text for hindi textAndroid TextView 没有为印地语文本包裹起来
【发布时间】:2014-04-01 06:04:39
【问题描述】:

目前,当我试图在文本视图上显示文本时,我在应用程序中遇到了一个问题,该文本是 textView 上的 HINDI 字体文本,它不会换行。它看起来像

我的TextView 代码是

<TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:gravity="center_horizontal"
    android:padding="10dp"
    android:textSize="19sp"
    android:textColor="@android:color/white" />

谁能帮我解决这个问题?

【问题讨论】:

  • 包裹宽度而不是填充父项。
  • 发布你的android(java类)代码

标签: android android-layout textview android-styles


【解决方案1】:

为 TextView 尝试正确地跟随

android:maxLines="2"

【讨论】:

    【解决方案2】:

    将此添加到您的TextView

    android:ellipsize="none"
    android:singleLine="false"
    

    【讨论】:

      【解决方案3】:

      试试这个..

      <TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="10dp"
          android:layout_marginRight="10dp"
          android:gravity="center_horizontal"
          android:padding="10dp"
          android:textSize="19sp"
          android:layout_weight="1"
          android:ellipsize="none"
          android:maxLines="100"
          android:scrollHorizontally="false"
          android:textColor="@android:color/white" />
      

      【讨论】:

      • @SumitPatel 尝试将宽度更改为 wrap_content android:layout_width="wrap_content"
      • @SumitPatel 它对我有用。好的,给定宽度固定值,例如 300dp
      猜你喜欢
      • 2023-03-06
      • 1970-01-01
      • 2011-09-12
      • 1970-01-01
      • 2018-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-09
      相关资源
      最近更新 更多