without ScrollView, my buttons look fine but after I use it, the buttons disappear, I tried a lot at solution but the thing appear is just <TextView>. How can I make them appear as preferred? activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" android:background="@drawable/background"> <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical"> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="20dp" android:orientation="vertical"> <TextView android:id="@+id/HeaderText" ..
I understand that any XML elements with ID should be automatically pull into an activity class through view binding. However, Android Studio keeps suggesting that my button is a nullable and needs to have ?. or !!. for it to compile. If I assert non-nullable with !!., it actually result in a runtime NullPointerException for ..
After 4 months of being inactive i realized that there are some changes. Now when you make a new button it is purple and has some padding defined. Managed to kill the purple color by editing the theme, but i still have issues with padding. When i make a new button, by default it has ..
I am trying to set background color and border color of Button using Shape Drawable (create button_start.xml in drawable) in Android 8, but it does not seem to work. button_start.xml file: activity_main.xml file: result: Source: Android..
Basically, I want the white button view not to have that grey padding, while retaining the button properties, so the click can be visible. Source: Android..
I am trying to change the background color and text color of a material button-through style. However, I see no change in IDE and as well as on phone. Here is a screenshot of the issue. The button next to cancel misbehaves, after checking in tons of attributes I fail to change background color. Here ..
I just started learning Android a few days ago. When I am playing around with Button today, I noticed that I am not able to set border as expected. xml files below: Button partin activity_main.xml: <Button android:layout_width="200sp" android:layout_height="100dp" android:background="@drawable/start_button_selector" app:backgroundTint="@color/start_button_color_selector" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:layout_constraintVertical_bias=".4" /> start_button_selector.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/arrow_button"> <shape ..
Actually that’s exactly what I want, seen in the picture below Place Buttons or TextViews on line. Source: Android..
The Android Button has only ACTION_UP, ACTION_DOWN, and ACTION_MOVE states, so I can’t hold down the Button for a long time… As a simple example, I want to make a top, bottom, left and right Button and move the square box displayed on the screen (drawRect drawn on Canvas). I want to implement a state ..
I am coding a "set pin" fragment for the second time and it’s not working. Everything works great until I use switch blocks and View.OnTouchListener. I am trying to change the buttons background resource to a different drawable when pressed down and then back when finger is lifted. My problem is that the background resource ..