Well, I'll say it like this.
I have a table with 2 columns. The first colum has names of items, the 2nd colums contains x amount of logos/indicators (ImageButtons). Several items can have the same logo/indicators.
My question is can I assign several ImageButtons to the same id? I've tried with using android:id="@+id/logo1"
on the first and then "android:id=@id/logo1"
on all the following occurences. This does not seem to work however. I can probably assign each button a different id and then just assign those to the same View, but it would be so much easier if I could just repeat the same ImageButton id for all the similar logos/indicators.
It is not recommended to use same id for multiple elements. Replace id with class attribute. I have done a sample code that will give you a brief idea on coding part.
An id on a <button> tag assigns an identifier to the button. The identifier must be unique across the page.
Complete HTML/CSS Course 2022yes, multiple submit buttons can include in the html form.
Let's learn the steps of performing multiple actions with multiple buttons in a single HTML form: Create a form with method 'post' and set the value of the action attribute to a default URL where you want to send the form data. Create the input fields inside the as per your concern. Create a button with type submit.
No, you can't use the same ids in same layout if there behavior is different.
Yes, you can use the same ids but in different layouts. In fact, it may be good practice to.
Android has some default id here they are declaring in ids.xml and reusing it in different views.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With