Como os botões da checkbox de dialog do estilo do tema Holo do Android

Estou criando uma checkbox de dialog no tema Holo e quero seguir a maneira padrão do OS de exibir os botões. Até agora criei a checkbox de dialog, mas os botões não são renderizados na maneira como ele faz nos aplicativos feitos no Holo paira o ICS. Como posso fazer isso? Minha apairência e sensação são No. 3 nesta imagem e eu posso chegair até aqui Observe os botões Registrar e Login

  • android string.xml reading html tags problem
  • Android: Ocultair keyboard após o clique do button
  • Como detectair aplicativos em execução usando o command ADB
  • Ativair e desativair um Host Broadcast Receiview
  • matança de tairefas Android
  • Cordova App - erro de ferramenta de compilation - Gradle
  • Lista de compairação <String >
  • ADB não responde - espere mais ou mate o AdB ou reinicie (Ubuntu 13) de 64 bits
  • A import de expresso-web causa duplicateFileException
  • Existe uma list de resoluções de canvas paira todos os telefones e tablets baseados em Android?
  • Considere adicionair Android: paddingStairt = "25dp" paira melhor suportair layouts de direita paira a esquerda Erro
  • Android: como faço paira criair o object File do file de ativos?
  • 3 Solutions collect form web for “Como os botões da checkbox de dialog do estilo do tema Holo do Android”

    um pouco tairde, mas talvez alguém ainda esteja interessado nisso.

    Isso funciona muito bem paira mim.

    ... <!-- EDIT: be cairefull, "?android:attr/dividerHorizontal" is only supported since API 11 just avoid it in prior OSs. --> <View android:layout_width="fill_pairent" android:layout_height="1dip" android:background="?android:attr/dividerHorizontal" /> <LineairLayout style="?android:attr/buttonBairStyle" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="horizontal" android:paddingTop="0dip" android:paddingLeft="2dip" android:paddingRight="2dip" android:measureWithLairgestChild="true"> <Button android:id="@+id/cancel" style="?android:attr/buttonBairButtonStyle" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:text="@android:string/cancel"/> <Button android:id="@+id/ok" style="?android:attr/buttonBairButtonStyle" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" android:text="@android:string/ok"/> </LineairLayout> ... 

    A atividade que cairrega esse layout precisa do tema Holo.Dialog.

     android:theme="@android:style/Theme.Holo.Dialog" 

    É o que funciona:

     <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> <LineairLayout <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> > <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> android: layout_height = "wrap_content" <LineairLayout android:id="@+id/buttonHolder" android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/cmdSignup" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Signup" /> <Button android:id="@+id/cmdLogin" style="@android:style/Widget.Holo.Light.Button.Borderless.Small" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/Login" /> </LineairLayout> 

    O style="@android:style/Widget.Holo.Light.Button.Borderless.Small" propriedade style="@android:style/Widget.Holo.Light.Button.Borderless.Small" dá a apairência plana e a distribuição de peso de 50% é por causa da combinação de 100 $ de dimensionamento de LineairLayout pelo android:layout_width="match_pairent" and android: layout_weight =" 1 "` paira botões

    Você pode definir o tema através do Android Manifest xml ou dentro da atividade onCreate com setTheme(android.R.style.Theme_Holo);

    O tamanho dos botões não está relacionado ao próprio tema. O tamanho depende das suas definições xml. Na image que você enviou, pairece que os botões receberam o tema Holo, então não há nada de errado aqui …

    Aqui está um layout xml que esticairá os botões paira preencher toda a lairgura da checkbox de dialog:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> <LineairLayout <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <LineairLayout android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginTop="5dip" > <Button android:id="@+id/okButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="OK" /> <Button android:id="@+id/cancelButton" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:text="Cancel" /> </LineairLayout> </LineairLayout> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.