asked    Drew     2018-10-22       ios       79 view        1 Answer

[SOLVED] Autoshrinking text size for multiple ui labels

I have five ui labels for one view. All of them have variable text content. To prevent truncating I have to use Autoshrink text size. My ui labels are aligned in x axis top to bottom. The problem is; when autoshrinking, all ui labels have different font sizes. Is there a way to equalize font sizes of all ui labels when autoshrink. I use interface builder autolayout constraints. Thank you.

  1 Answer  

        answered    Theresa     2018-10-22      

You could loop through your labels, find the smallest text size and then set that text size to all of them. That way, you know they'll all fit and have the same text size. You would have to do this programmatically. Alternatively, you could dynamically change the size of your UILabels based on the number of characters it holds times some constant factor. That way, the autoshrink should set the same size for each the text in each of the labels.

Your Answer

 2018-10-22         Allen

How can i integrate chat feature in my Angular4 application?

I want to integrate chatting feature in Angular4 application with text message, smilies, attachment sharing, group chat etc.Chatting between the users of my application. Users list is available from my database. Want to do chat among them.Is there any open source frameworks for this?Please assist You can achieve that by Integrating Web Sockets, Node & Angular WebSockets is a protocol that provides a bi-directional communication channel. This means that a browser and web server can maintain real-time comms, sending messages back and forth while the connection is open...
 angular                     1 answers                     56 view
 2018-10-22         Freda

Parsing API Response (object) from component to another component in Angular 4

I want to parse API response to another componentThis is code from 'detail_item.component.ts', this code sent data to route "bookitem" in 'book_item.component.ts'onSubmit(){ this.appService.addItem(this.item).subscribe(item => { if(item.status ==200){ this.router.navigate(['/bookitem'], {queryParams: {data:}}); } })}this is code from 'book_item.component.ts'ngOnInit() { this.routeActive.queryParams.filter(params => => { this.book_item =; });}when I console.log(this.book_item), wh...
 angular                     2 answers                     56 view
 2018-10-22         Delia

Downloading Image in Angular 4

I am trying to download the image from UI in angular 4. So far, i've applied the following code to download the image:DownloadImageFromUrl(imageUrl) {imageUrl = this.ImagePath + imageUrl;this.Service.GetImage(imageUrl, { responseType: ResponseContentType.Blob }) .map(res => { return new Blob([res._body], { type: res.headers.get("Content-Type") }); }) .map(blob => { var urlCreator = window.URL; return this.sanitizer.bypassSecurityTrustUrl(urlCreator.createObjectURL(blob)); }) } Following the "GetImage" function:GetImage(url: string, options?: R...
 angular                     1 answers                     59 view