I can’t judge your skills, but my first impression is that this sounds like basic actions under layout (scaling and anchoring)
- take your text and underline
- Make sure they are hte same width
- group them
- In the separate components (the text, and underline) go to layout and give the following properties: Scale with group, and set the anchor the same on the components. From now on they should behave similar
- go to your group > layout and pick what you need. Fixed, or Scale with screen. Based on your images i’d guess you go for fixed sizes. Group on Fixed. Anchor left/right