首页 > 应用开发 > IT综合 > 背景透明的实现,直播电商源码是怎么做的
有时候,直播电商源码需要实现一个透明的背景效果,接下就看看直播电商源码是怎么实现吧!
1、自定义Dialog
public class SelectDialog extends AlertDialog{
public SelectDialog(Context context, int theme) {
super(context, theme);
}
public SelectDialog(Context context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.slt_cnt_type);
}
}
2、布局文件slt_cnt_type.xml代码
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="10dp" android:layout_width="115dp" android:layout_height="wrap_content" android:background="@color/blue"> <Button android:layout_height="wrap_content" android:background="#00000000" android:layout_width="fill_parent" android:text="全部联系人" android:paddingTop="5dp" android:paddingBottom="5dp" android:paddingLeft="10dp" android:gravity="left|center_vertical" android:id="@+id/btnSltCntAll"></Button> <Button android:layout_height="wrap_content" android:background="#00000000" style="@drawable/greenhand_button" android:text="咕咚用户" android:gravity="left|center_vertical" android:paddingBottom="5dp" android:paddingTop="5dp" android:paddingLeft="10dp" android:paddingRight="10dp" android:layout_width="fill_parent" android:id="@+id/btnSltGudongUser"></Button> <Button style="@drawable/greenhand_button" android:background="#00000000" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="推荐用户" android:gravity="left|center_vertical" android:paddingTop="5dp" android:paddingBottom="5dp" android:paddingLeft="10dp" android:id="@+id/btnSltRecommend"></Button> </LinearLayout>
就这样,直播电商源码实现了简单的透明背景效果。
声明:本文由云豹科技转发自一叶飘舟过博客,如有侵权请联系作者删除
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/70002045/viewspace-2793592/ ,如需转载,请注明出处,否则将追究法律责任。