Coder Social home page Coder Social logo

Comments (17)

Ifuqiang avatar Ifuqiang commented on May 26, 2024

我也出现了这样的情况

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

好歹也给个文字复制下啊

from android-justifiedtextview.

Ifuqiang avatar Ifuqiang commented on May 26, 2024

和什么字没关系, 就是最后一行会被拉伸(有些情况),有的情况又不会;如图,最后一行剩下 某个文字和句号的情况,有的情况会被拉伸 有的情况有不会;
device-2015-04-21-171829
device-2015-04-21-171848

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

image
为什么我这边的松岛枫是正常的,你的模拟器分辨率是多少

@laizony

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

@Ifuqiang 给textview设定一个固定宽度,然后重现bug
然后再把文字内容和宽度发给我

from android-justifiedtextview.

laizony avatar laizony commented on May 26, 2024

text = "松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫,Genymotion for person use松岛枫";
@ufo22940268

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

@laizony 宽度是多少px也给一下

from android-justifiedtextview.

Ifuqiang avatar Ifuqiang commented on May 26, 2024

@ufo22940268 我现在改不了源码.明天改测试下; 我用的是真机. 这个宽度是android:layout_width="match_parent" 设置的;

from android-justifiedtextview.

laizony avatar laizony commented on May 26, 2024

layout是这个:activity_text.xml

java文件是在这里的62行把text换了:TextActivity.java
@ufo22940268

from android-justifiedtextview.

laizony avatar laizony commented on May 26, 2024

使用文件读取进来是没有这个问题的,在layout里直接设置和在代码里设置才会出现这个问题。
@ufo22940268

from android-justifiedtextview.

laizony avatar laizony commented on May 26, 2024


第二个文本:

TextView two = (TextView)findViewById(R.id.two);
String text="明月几时有?把酒问青天。不知天上宫阙,今夕是何年。\n"
          +"我欲乘风归去,又恐琼楼玉宇,高处不胜寒。\n"
          +"起舞弄清影,何似在人间。\n"
          +"转朱阁,低绮户,照无眠。不应有恨,何事长向别时圆?\n"
          +"人有悲欢离合,月有阴晴圆缺,此事古难全。\n"
          +"但愿人长久,千里共婵娟。";
two.setText(text);

布局的代码:

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:padding="20dp" >

    <com.example.processdemo.JustifyTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫松岛枫,Genymotion for person use松岛枫"
        android:textColor="@android:color/holo_blue_light"
        android:textSize="16sp" />

    <com.example.processdemo.JustifyTextView
        android:id="@+id/two"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text=""
        android:textColor="@android:color/holo_blue_light"
        android:textSize="16sp" />

    <com.example.processdemo.JustifyTextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:text="1yc2EAAAADAQABAAABAQCmQbnMDF0WCAEwKjGxrXD3oHZpmyWfsm1FHrvZqbJZh210zE/IpmGhBUUxsbkce5JCa+plat1y9saFLSpphaGIfOUJdPbnfgfqfnO3IFT8rLVf+FVetwbCbzEw7t6FStITyLEZSgs7TBRdoLWgPYXMd7GhfyEX+4n8HULufFJ2a/UJLzzUl1jo3PgOvqG18ujNtByixEwCt2Z3zFlQcd5CoXaYUbeDi94aSvnXntA+/E+aPwwaX8nB/ar3LlGy13cm9hutyoTWJ/mgfotw8a+9OBW0ChZPdETDhpgQMuW+W+nwapO6GxUMX+C3xbQgQNn1oWhf9uuSIaarg3Q"
        android:textColor="@android:color/holo_blue_light"
        android:textSize="16sp" />
</LinearLayout>

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

我努力了,但是暂时没找到好的方法修复。因为很难找到和英文字母等宽的并且能够被换行的字符。

from android-justifiedtextview.

laizony avatar laizony commented on May 26, 2024

@ufo22940268 能否问一下,为什么从文件读取没有问题呢?

from android-justifiedtextview.

liuying3013 avatar liuying3013 commented on May 26, 2024

snip20150515_1

from android-justifiedtextview.

liuying3013 avatar liuying3013 commented on May 26, 2024

字会被拉伸到填满整行

from android-justifiedtextview.

dnzl123 avatar dnzl123 commented on May 26, 2024

这个问题没法解决吗

from android-justifiedtextview.

ufo22940268 avatar ufo22940268 commented on May 26, 2024

估计是可以的,不过我电脑上没有android开发环境,靠各位大牛了

from android-justifiedtextview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.