答案 0 :(得分:1)
您需要使用自定义布局制作自己的Dialog
def slider_drag_callback(*args):
print 'Slider Dragged'
window = cmds.window()
cmds.columnLayout()
cmds.rowColumnLayout(nc=2, cw=[(1, 50), (2, 40), (3, 300)])
cmds.checkBox(l="Trans")
cmds.checkBox(l="Rot")
cmds.floatSliderGrp(label="Sldr", field=True, value=0, dc=slider_drag_callback)
cmds.setParent('..')
cmds.showWindow(window)
<强> custom_dialog.xml 强>
Dialog dialog;
private void showDialog() {
// custom dialog
dialog = new Dialog(this);
dialog.setContentView(R.layout.custom_dialog);
// set the custom dialog components - text, image and button
ImageButton close = (ImageButton) dialog.findViewById(R.id.btnClose);
Button buy = (Button) dialog.findViewById(R.id.btnBuy);
// Close Button
close.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
//TODO Close button action
}
});
// Buy Button
buy.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
//TODO Buy button action
}
});
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.show();
}
结果是:
答案 1 :(得分:0)
您可以使用此库。右上角有一个关闭按钮。只需要设置图像。