Coder Social home page Coder Social logo

Comments (10)

ssomai avatar ssomai commented on August 16, 2024

안녕하세요! 잘써주시니 오히려 제가 감사드립니다 ㅎ

textview_wrapcontent_direction에 대한 max값 정말 괜찮은 기능입니다 ^0^
작업하고 말씀드릴게요~ ㅎ

제가 알기로는 기존 textview에서 maxlines가 1일때만 ...가 되는 걸로 알고 있는데
혹시 제가 잘못 알고 있는건가요~?;;

from scalablelayout.

LEE-SANG-JIN990 avatar LEE-SANG-JIN990 commented on August 16, 2024

가끔 예외적인 상황도 있지만 maxlines에 부여된 라인수까지 보여주고 말줄임 처리되는걸로 알고 있습니다.
wrapcontent max value 지정할 수 있는 기능이 전부터 있었음 좋겠다고 생각했는데 이제서야 문의드리게 되었네요 ㅎㅎ 좋은 하루 되세요~

from scalablelayout.

ssomai avatar ssomai commented on August 16, 2024

말줄임표에 대한 구체적인 상황 설명을 부탁드려도 될까요~? ㅎ

from scalablelayout.

LEE-SANG-JIN990 avatar LEE-SANG-JIN990 commented on August 16, 2024

현재 제 상황을 말씀하시는 건가요? 간단하게 설명드리면 ScalableLayout 안에 Textview와 그 우측에 뷰가
하나 있구요. TextView는 1줄로 표시해야하며, 정해진 위치까지만 표시하고 (base_width라던지 값으로 특정할 수 있는 수치) 끝에 도달하면 말줄임표(...)를 표시하려고 합니다.
TextView 우측에 뷰를 하나 붙여야 되는 상황이라 고민중이었습니다 ㅠ

      <com.ssomai.android.scalablelayout.ScalableLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"

            sl:scale_base_width="506"
            sl:scale_base_height="120">

            <TextView
                android:id="@+id/txtView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/C_333333"
                android:gravity="left|center_vertical"
                android:maxLines="1"
                android:ellipsize="end"

                sl:scale_left="0"
                sl:scale_top="0"
                sl:scale_width="280"
                sl:scale_height="120"
                sl:scale_textsize="45" 

                sl:textview_wrapcontent_direction="right"
                sl:textview_wrapcontent_resizesurrounded="false"
                sl:textview_wrapcontent_movesiblings="true"/>

             <!-- TextView 우측에 위치시킬 뷰... -->
             <View ... />

        </com.ssomai.android.scalablelayout.ScalableLayout>

간단하게 레이아웃 첨부해 봅니다.
base width는 506이며 TextView는 280으로 예를 들어 잡아보았습니다.
textView의 문구는 가변적이어서 짧으면 280보다 짧아질 것이고 길면 그만큼 늘어나겠지요.
원하는건 긴 문구가 들어가서 늘어났을때 base width인 506을 안넘고 그 안에서 wrapcontent가 되며
maxLines가 1이므로 끝에 말줄임표(...)가 붙는 것입니다.

from scalablelayout.

ssomai avatar ssomai commented on August 16, 2024

오 상세한 설명 감사합니다~
작업하고 말씀드릴게요~

from scalablelayout.

ssomai avatar ssomai commented on August 16, 2024

안녕하세요~ 요청하신 기능 작업해서 올렸어요~

확인해보시고 이상하거나 다르면 알려주세요~

링크

from scalablelayout.

LEE-SANG-JIN990 avatar LEE-SANG-JIN990 commented on August 16, 2024

오오 작업이 벌써 다 되셨군요~~
꼭 필요한 기능이었는데 잘됬네요.
감사합니다!!

from scalablelayout.

LEE-SANG-JIN990 avatar LEE-SANG-JIN990 commented on August 16, 2024

maxLines와 ellipsize 속성도 원하는데로 잘 적용이 되는군요.
UI개발이 조금 더 편해질 것 같습니다.
복잡한 UI 개발에 활용하면 정말 좋을 듯 합니다~~

from scalablelayout.

ssomai avatar ssomai commented on August 16, 2024

앗 답변 이제야 봤네요 잘 사용해주신다니 감사합니다~ ^^

from scalablelayout.

ssomai avatar ssomai commented on August 16, 2024

안녕하세요~ width height값은 그냥 비율이기 때문에 무슨 값이든 임의적으로 잡으시면 됩니다 ㅎ

from scalablelayout.

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.