android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:inputType = "numberDecimal" // for decimal numbers
android:id="@+id/editText1" // This will be used in the program to reference this EditText box.
android:layout_width="match_parent" // These two determine the size of the box on screen. The first is horizontal, second is vertical.
android:layout_height="wrap_content" /> // This is the size of what you type in it, not the box itself. The wrap content means that it will expand if you type more than one line. match parent means it takes up as much space as its parent element (the LinearLayout in this case) allows. You can also set explicit sizes using "dp", like 100dp or 200dp for example, but that might make your app look weird on different screens with different resolutions and aspect ratios and stuff. For now just use wrap content or match parent until you get a better understanding of how all this works together...and when you do get a better understanding, feel free to post another question about why your explicit sizes aren't working as expected! :)
</LinearLayout> // Don't forget to close out your LinearLayout! Good luck with your coding!! :)
</code>
创作工场
免责声明:
以上内容除特别注明外均来源于网友提问,创作工场回答,未经许可,严谨转载。
点击这里>>使用🔥专业版,更聪明、更完整、更原创!