Android TextView不显示完整的长文本

时间:2016-02-26 03:01:13

标签: android textview

TextView

我遇到了一个问题,setText没有显示完整的文字,我绝对不能限制代码中的文本长度(也不能限制其他内容!)。

当我使用getText时使用以下字符串:

  

qwertyuyiopasdfghjklkjsdfhvrtcgwrgcrcrfcwerm,fixcumreiovtreuiocfmruefcmeroiwurewmiohgxiehgiocwrhhhhwemoggruiohwgcioweruhcmrehxrmeihouxe,horhxihuxchfjkhjklsdfhdlkfhdsjflkasdhjfhaskldfhdkljfhsadjfkhdsjfdsakflajdasghsdlkacvnsadohlkfjhdjkflsadhkjfhasdlkfhdsjlkfhdjlkfhasdjfhicnerjsdklfhdjsklfhdsjklfhasdjklvcnsldkjfldksfhajsldkfhdjklsjfhasdjklf789456123

它只显示:

  

qwertyuyiopasdfghjklkjsdfhvrtcgwrgcrcrfcwerm,fixcumreiovtreuiocfmruefcmeroiwurewmiohgxiehgiocwrhhhhwemoggruiohwgcioweruhc

enter image description here

但是Hierarchy Viewer会返回完整的字符串,如declare @jobname [sysname] = 'Check' Select nextOne = min( case freq_subday_type when 8 then dateadd(hour , (Datediff(hour , [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time), getdate())/freq_subday_interval + 1) * freq_subday_interval, [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time)) when 4 then dateadd(minute, (Datediff(minute, [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time), getdate())/freq_subday_interval + 1) * freq_subday_interval, [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time)) when 2 then dateadd(second, (Datediff(minute, [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time), getdate())/freq_subday_interval + 1) * freq_subday_interval, [dbo].[agent_datetime](sjs.next_run_date, sjs.next_run_time)) end) FROM msdb.[dbo].[sysschedules] ss inner join msdb.[dbo].[sysjobschedules] sjs on ss.schedule_id = sjs.schedule_id inner join msdb.[dbo].[sysjobs] sj on sjs.job_id = sj.job_id where sj.Name = @jobname and ss.enabled = 1 屏幕截图所示!

enter image description here

3 个答案:

答案 0 :(得分:0)

您的文字太长,请尝试将文字视图置于滚动



<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="40dp"
    android:layout_marginBottom="40dp"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.bala.computer.thenaliramanstories.ScrollingActivity">


    <WebView
        android:id="@+id/txtStory"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"/>

</android.support.v4.widget.NestedScrollView>
&#13;
&#13;
&#13;

答案 1 :(得分:-1)

更改 LinearLayout的 android:layout_width="match_parent"

答案 2 :(得分:-1)

您的父视图的宽度为100dp。

android:layout_width="100dp"
              android:layout_height="50dp"

将它们更改为match_parent,它应该没问题