programing

안드로이드에서 타원 크기란 무엇을 의미합니까?

jooyons 2023. 11. 6. 21:47
반응형

안드로이드에서 타원 크기란 무엇을 의미합니까?

추가했습니다.EditText제 레이아웃에 힌트를 넣어서 가로로 중심을 잡았습니다.

애플리케이션을 실행할 때 힌트가 보이지 않았습니다.저는 제가 만들어야 한다는 것을 알았습니다.ellipsize의 가치TextView되려고start:

<EditText
    android:id="@+id/number1EditText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:ellipsize="start"
    android:ems="10"
    android:gravity="center_horizontal"
    android:hint="@string/hint1" />

Android 설명서에서 다음과 같이 읽습니다.

설정된 경우 보기보다 긴 단어가 너비가 됩니다.
중간에 부러지지 않고 타원형으로 되어 있습니다.

문제는.ellipsize사전에 없습니다.우리가 어떤 혜택을 얻을 수 있는지 누가 설명해 줄 수 있습니까?ellipsize속성?그리고 다른 점은?start,end,middle?

여기에서 설명서를 찾을 수 있습니다.

요구 사항에 따라 옵션에 따라 시도해 볼 수 있습니다.

타원 크기, 신조어는 타원을 사용하여 텍스트를 단축하는 것을 의미합니다. 즉, 세 개의 점....또는 더 일반적으로 결찰을 합니다., 생략된 비트를 대신합니다.

원래 값 pf 텍스트 뷰를 aabbccc 및 뷰 내부에 맞는 것이라고 말합니다.

start의 출력은 ...bccc가 됩니다.

end의 출력은 aaab...

middle의 출력은 aa...cc가 될 것입니다.

marquee의 출력은 aabbccc가 오른쪽에서 왼쪽으로 자동 슬라이딩됩니다.

제 경험으로는 아래 두 가지 속성이 설정되어 있을 경우에만 엘리시스가 작동합니다.

android:ellipsize="end"
android:singleLine="true"

폭에 대하여TextView,wrap_content아니면match_parent둘 다 좋을 겁니다

android:ellipsizeAPI Level 1. An에 추가되었습니다.ellipsis3교시 연속입니다. (...)

.xml에

 <TextView
       ....
       android:text="Hi I am Amiyo, you can see how to ellipse works."
       android:ellipsize = "end" />

이 시점에서 타원은 아직 다음과 같이 표시되지 않습니다.TextView새 텍스트를 입력하면 기본값으로 자동 확장되도록 설정됩니다.제한해야 합니다.TextView어떤 면에서는이 작업을 수행하면 다음 작업에 추가를 사용할 수 있습니다.TextView a scrollHorizontally,minLines, 아니면maxLines타원을 보여줄 수 있습니다.

타원을 만드는 방법:

    at the end: this is how it would.   
    use: android:ellipsize = "end"

그리고.

 in the middle:
 use: android:ellipsize = "middle"

그리고.

 at the start:
 use: android:ellipsize = "start"

그리고.

 to have no ellipse
 use: android:ellipsize = "none"

참고:

Do not use android:singeLine = "true", it is deprecated.
android:maxLines = "1" will not display the three dots (...)
android:lines = "1" will not display the three dots (...)

자세한 사항은 여기에서 확인하실 수 있습니다.

타원은 3개의 주기를 연속으로...

텍스트 보기는 모든 텍스트를 표시하도록 확장할 수 없을 때 생략형을 사용합니다.속성ellipsized필요한 경우 세 점의 위치를 설정합니다.

텍스트:

 This is my first android application and
 I am trying to make a funny game,
 It seems android is really very easy to play.

위가 당신의 텍스트라고 가정하고 만약 당신이ellipsizestart이런 식으로 보일 겁니다.

This is my first android application and
...t seems android is really very easy to play.

와 함께end기여하다

 This is my first android application and
 I am trying to make a funny game,...

여기에 예가 있습니다.ellipsize감가 상각하지 않은 작업android:singleLine="true"일순간에ConstraintLayout:

<TextView
   android:layout_width="0dp"
   android:layout_height="wrap_content"
   android:textSize="13sp"
   android:ellipsize="end"
   android:maxLines="2"
   app:layout_constraintEnd_toEndOf="parent"
   app:layout_constraintStart_toStartOf="parent"
   tools:text="long long long long long long text text text" />

만약 당신이 한 줄에 있어야만 하는 텍스트를 가지고 있다면 기억하세요, 그리고 변경합니다.maxLines1 대 1.

참고: 다음을 표시하려면 텍스트가 컨테이너 상자보다 커야 합니다.

 android:ellipsize="marquee"    

이 속성을 다음으로 설정합니다.EditText.Ellipsize사용 안 함으로 작업 중입니다.EditText

android:lines="1"
android:scrollHorizontally="true"
android:ellipsize="end"
android:singleLine="true"
android:editable="false"

아니면setKeyListener(null);

너비가 고정되어 있을 때는 타원 크기를 사용합니다. 그러면 자동으로 텍스트가 잘려지고 끝에 타원이 표시됩니다.

layout_width를 wrap_content & match_parent로 설정하면 작동하지 않습니다.

android:width="40dp"
android:ellipsize="end"
android:singleLine="true"

(배치 또는 설정 제한의 크기로 인해) 텍스트 공간이 충분하지 않은 경우 위에서 이미 언급한 바와 같이, 타원 크기로 인해 ...개의 점이 추가됩니다.

여기에 예가 있습니다.상단: 타원 크기(여기서는 '끝' 하단: 없음)로 설정됩니다.

언급URL : https://stackoverflow.com/questions/13313996/what-does-ellipsize-mean-in-android

반응형