2016-06-30 75 views
0

有與棒棒糖設備的視圖高度相關的帖子。我應用了可應用於對話框的技巧,但仍無法在對話框中添加高度/陰影。高程/陰影到21歲以前或棒棒糖前的對話框

我試過這種風格,但它沒有奏效。

<item name="android:background">@android:drawable/dialog_holo_light_frame</item> 

ViewCompat.setElevation()和View.setOutLineProvider()方法可從棒棒糖。所以不能使用它們。

我不能在這裏添加screeshots,原因不明。但對話在KK上是平坦的,並且在棒棒糖上看起來很高,看起來不錯。

這是我如何創建對話框:

AlertDialog.Builder builder = new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AlertDialogStyle)); 
Dialog dialog = builder.create(); 

而且AlertDialogStyle僅僅是這樣的:

<style name="AlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert"> 
</style> 

你能不能幫我,我怎麼可以添加海拔對話框預棒棒糖任何線索或21歲以前的設備?

回答

0

嗯,這不是問題的答案,但它是我必須做的一個選擇,以便在應用程序中工作。

所以,我用PopupMenu代替對話,改變了我的應用程序從主題

<style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> 

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">