How to set **`UILabel`** according to **text** but I want **`backGroundColor`** also in it, if **text** is small then it will display **background small label with background color black** and text and vice-versa.How to do?

![enter image description here](https://i.stack.imgur.com/4KSO6.png)

In image the black background color came according to the dynamic text. I want black background color till the text India.