Add a text box Figure 5. The text box is constrained to the top and left of the parent layout First, you need to remove what's already in the layout. So click TextView in the Component Tree window, and then press Delete. From the Palette window on the left, click Text in the left pane, and then drag Plain Text into the design editor and drop it near the top of the layout. This is an EditText widget that accepts plain text input. Click the view in the design editor. You can now see the resizing handles on each corner (squares), and the constraint anchors on each side (circles). For better control, you might want to zoom in on the editor to 75% or higher using the buttons in the toolbar. Click-and-hold the anchor on the top side, and then drag it up until it snaps to the top of the layout and release. That's a constraint—it specifies the view should be 16dp from the top of the layout (because you set the default margins to 16dp). Similarly, create a c
Comments
Post a Comment