Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1018489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:51:56+00:00 2026-05-16T10:51:56+00:00

I tried to set up my togglebutton properties layout using style.xml. Here’s my code:

  • 0

I tried to set up my togglebutton properties layout using style.xml.
Here’s my code:

    <ToggleButton android:id="@+id/button_toggle_1" style="button_test_1"/>

    <ToggleButton android:id="@+id/button_toggle_2"
        android:textOff="test2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <ToggleButton android:id="@+id/button_toggle_3" style="button_test_3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

For ID=button_toggle_1, I apply a style (style.xml), here’s the code:

<style name="button_test_1">
    <item name="android:textOff">test1</item>
    <item name="android:layout_width">wrap_content</item>
    <item name="android:layout_height">wrap_content</item>
</style>

<style name="button_test_3">
    <item name="android:textOff">test3</item>
</style>

I can see button 2 and 3 but the text for button 3 is different from what I set it to be. button 3 text = “APAGADO”. From this test, I conclude that togglebutton simply cannot set its properties using style.xml. Is this true? or did I do something wrong?

If toggle button is “special”, anyone knows the reason why? is this “special” condition applies to other things as well?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T10:51:56+00:00Added an answer on May 16, 2026 at 10:51 am

    You are not referencing the styles correctly. It is style="@style/style_name". See documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to set the tick style to tsManual, the min and max position
I tried to set the usergent using Inet1.Execute , GET, Referer: yahoo.com & vbCrLf
I've tried to set the margin and border to 0,but still not working. <style
I’m using a JPanel to add JComponents on and I tried to set the
I want to achieve this using html and css: I have tried to set
I want to remove the font padding from an Android button? I've tried set
I tried to set a connection timeout with the following code: public class ConnectionTimeout
I tried to set the background color of a data grid view to be
I tried to set up the date_select in my HAML template for displaying just
I've tried to set up a Django model with a python property, like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.