user interface - Android: How to keep switch and label together -


I'm trying to put a switch and its label together.

  & lt; Switch Android: Id = "@ + id / switch" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" Android: background = "#FFFFFF" Android: text = "this is a label" />  

The problem I have is that the switch and its label differ from opposite sides of the screen. I know that I can change Android: layout_width = "wrap_content" but I'm trying to create a white background (#FFFFFF) which is the content height and screen width. I also know that I can put a switch in a relative layout with this background, but I think that this extra unnecessary view will have to be made. Is there any way to stop switch labels from switching from switch?

Thanks in advance!

I have written a precise problem and wrote about it.

This will give you a component on the right with a switch (or check box based on the API version), and its label left. Just like the Preferences screen The status of a touch switch will change on the label and surrounding layout.

If you want to get the view you want, you can modify and rearrange the switch.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -