hi i want to create a control for my activty which is just like an android default dialpad number showing control. i created edittext control for it.
<EditText android:id="@+id/editid"
android:hint="Enter your number"
android:layout_width="fill_parent"
android:scaleType="center"
android:singleLine="true"
android:cursorVisible = "false"
android:layout_height="wrap_content"
>
</EditText>
But its not looking great as i am trying to show the inpput number from centre and keep on decreasing its text size if there are more numbers entered upto a certain size.Also i am unable to set its background drawable to make it look like dialpad’s input box.
i also tried with button control.
<Button android:layout_height="45dp"
android:textSize = "25dp"
android:singleLine = "true"
android:id="@+id/input_number"
android:textColor = "@color/white"
android:layout_width="320dp"
android:background="@drawable/num_button">
</Button>
its showing exactly as i want but the problem is now i am not been able to set its text from qwerty keypad as edit text was taking it automatically.
Please someone suggest me which control to choose and get the desired behaviour.
Thanks
Set the gravity of
Editextas center and it will work