I would like to create a custom button like this:
But what works I do not want to show the text on the button to show the button with the absolute position relative to the original All the strings need to be unstable on the runtime
But the button below can be a regular button
How can I do this?
If I create a button by the inheritance from android.widget.button, then I have to pull the whole button myself?
Is there an easy way
edit
OK, I tried to inherit relative layout
like this:
package be.smarttelecom.datacheck.views; Import android.content.Context; Import android.util.log; Import android.widget.RelativeLayout; Import android.widget.TextView; Public Class Alert Button Raises the Relative Layout (Private Text View Room Number); Public alert button (reference references, string roommember) {super (reference); {This.alertId = alertId; // Tudo Auto-Generated Constructor Stub This. CETL TradePart (new layoutprim (layout parameter.philpaint, layout paragraph WRAP_CONTENT)); Textview room = new textview (reference); Room.setFocusable (wrong); Room.setText (R.string.room); Room. Settlement side (new layout pram (layout perm. WRAP_CONTENT, layout para. WRAP_CONTENT)); This.roomNumber = New text view (reference); This.roomNumber.setFocusable (wrong); This.roomNumber.setId (R.id.roomNumber); This.roomNumber.setTextSize (26); This.roomNumber.setLayoutParams (new layoutprim (layout perm. WRAP_CONTENT, layout para. WRAP_CONTENT)); This.roomNumber.setText (roomNumber); } Hold (Exception Pre) {Log.i ("Trial", "Problem while creating warning button:" + east .getMessage ()); }} Public Zero Setup Number (string number) {roomNumber.setText (number); } Public Zero Setdition (string description) {this.description.setText (description); }} When I add it like this:
table row line 2 = new table (this); Alert button warning = new alert button (this, "1", "14", "wc", "crist"); Row2.addView (warning); Container.addView (line2, 0); I get an empty page and there are no errors
Any thoughts that I have done?
How do I definitely textfield posts? Put them inside a full layout and add x one y coordinate? (Full layout is depricated, optional?)
I think the easiest to create a custom view The method increases the relational layout . Then you can add 4 TextView s to see whatever you want with whatever customization you want and to act as a button, you can add a width and height You can set and add a button to fill_parent, make sure your TextView s is not Focusable and this button has been sent behind the layout.
Alternatively, you can add a drawback in the form of your visual background to be clickable = true and focusable = true in your custom view in relative layout Looks like a button. Use a selector to handle all centered / pressed states like an actual button. Details of how to obtain it can be found here:
Comments
Post a Comment