我需要在我的應用程序中使用AlertDialog
,該應用程序從文本文件中讀取內容。對於我做了如圖http://bees4honey.com/blog/tutorial/adding-eula-to-android-app/如何在alertdialog中對齊消息?
這真的幫助了我,是爲那些誰需要幫助一個很好的教程...
但我需要的是AlertDialog
中央對齊內顯示的文本.. 如何我可以這樣做嗎?
我曾試過自定義對話框......但我無法得到它的工作.. 我已經檢查了許多網站的參考,但我沒有得到一個很好的教程。 任何人都可以描述如何製作自定義AlertDialog以及對話框內的消息如何對齊?
我在值
<style name="RightJustifyTextView" parent="@android:style/Widget.TextView">
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_centerVertical">true</item>
</style>
<style name="RightJustifyDialogWindowTitle" parent="@android:style/DialogWindowTitle">
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_centerVertical">true</item>
</style>
<style name="RightJustifyTheme" parent="@android:style/Theme.Dialog.Alert">
<item name="android:textViewStyle">@style/RightJustifyTextView</item>
<item name="android:windowTitleStyle">@style/RightJustifyDialogWindowTitle</item>
</style>
</resources>
但風格RightJustifyTextView和RightJustifyTheme顯示錯誤書面Styles.xml ..
,我已經更新了我的最終用戶許可協議文件,
public class RightJustifyAlertDialog extends AlertDialog {
public RightJustifyAlertDialog(Context ctx) {
super(ctx, R.style.RightJustifyTheme); } }
我不確定我有什麼完成。但只是試圖做類似http://s401.codeinspot.com/q/2052397
一步一步desription將是誰正在學習的Android編程... 期待着良好的描述答案的學生非常有幫助..
您可以發佈自定義AlertDialog的代碼? – ingsaurabh
[這會幫助你。] [1] [1]:http://stackoverflow.com/questions/4954130/message-text-in-android-dialog-box – Ricky