[SwiftUI] How to specify the abbreviated position of Text

image.png

I couldn't find the information because it wasn't easy to find, so I finally found it by searching with "Swift UI Text Overflow". It's full of letters.

struct TestView: View {
    var body: some View {
        VStack{
            Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
                .truncationMode(.tail)
                .lineLimit(1)
            Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
                .truncationMode(.head)
                .lineLimit(1)
            Text("Use truncationMode to specify the Text abbreviation in SwiftUI")
                .truncationMode(.middle)
                .lineLimit(1)

        }
    }
}

By setting truncationMode in this way, you can adjust the position to make" …… ".

Recommended Posts

[SwiftUI] How to specify the abbreviated position of Text
How to determine the number of parallels
How to sort the List of SelectItem
How to find the cause of the Ruby error
How to get today's day of the week
Output of how to use the slice method
How to display the result of form input
[Java] How to get the authority of the folder
How to specify index of JavaScript for statement
How to delete / update the list field of OneToMany
How to write Scala from the perspective of Java
[Ruby] How to find the sum of each digit
How to install the root certificate of Centos7 (Cybertrust)
[Java] How to get the maximum value of HashMap
[Rails] How to change the column name of the table
[Android] How to get the setting language of the terminal
How to specify the resource path in HTML import
[Rails] How to get the contents of strong parameters
How to judge the click of any area of the image
Install MySQL 5.6 on CentOS6 [How to specify the version]
How to download the old version of Apache Tomcat
[Swift] How to get the document ID of Firebase
I want to return the scroll position of UITableView!
How to display the select field of time_select every 30 minutes
How to get the longest information from Twitter as of 12/12/2016
How to change the setting value of Springboot Hikari CP
[Ruby] How to retrieve the contents of a double hash
How to add elements without specifying the length of the array
Let's summarize how to extend the expiration date of Rails
How to solve the problems of Java's three Blocking Queues
[Rails] How to display the list of posts by category
How to mock some methods of the class under test
How to derive the last day of the month in Java
How to change the contents of the jar file without decompressing
How to check the extension and size of uploaded files
[jsoup] How to get the full amount of a document
How to check the database of apps deployed on Heroku
I checked the specification of how to specify cell attributes of AsciiDoc table & internal implementation of Asciidoctor
How to specify an array in the return value / argument of the method in the CORBA IDL file
[Swift] How to dynamically change the height of the toolbar on the keyboard
Qualify only part of the text
How to use the form_with method
[Rails] How to get the URL of the transition source and redirect
How to specify validation for time_field
How to find the average angle
[Swift5] How to get an array and the complement of arrays
How to set the IP address and host name of CentOS8
How to use the wrapper class
How to display 0 on the left side of the standard input value
How to use setDefaultCloseOperation () of JFrame
[Rails / Heroku / MySQL] How to reset the DB of Rails application on Heroku
[Swift UI] How to get the startup status of the application [iOS]
I made a gem to post the text of org-mode to qiita
How to get the contents of Map using for statement Memorandum
[Rails] How to omit the display of the character string of the link_to method
[Rails] How to change the page title of the browser for each page
How to get the id of PRIMAY KEY auto_incremented in MyBatis
I examined the concept of the process to understand how Docker works
How to add the delete function
[chown] How to change the owner of a file or directory
How to check for the contents of a java fixed-length string