当前位置的Acitvity施加一个主题对话在特定的X,Y位置 [英] Positon an Acitvity applied with a theme dialog at a particular x, y position

查看:70
本文介绍了当前位置的Acitvity施加一个主题对话在特定的X,Y位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将对话框上的特定位置在屏幕上(-10px从顶部和让-5px)。

I would like to place the dialog on a particular position on the screen(-10px from top and -5px from let).

我做应用的主题,并添加了安卓scrollX 安卓scrollY ,但它不似乎工作。

I did apply the theme and added the android:scrollX, android:scrollY, but it doesn't seem to work.

任何solutuions?

Any solutuions?

下面是我的造型XML。

Below is my styling xml.

<style name="Theme.MyDialog1" parent="android:style/Theme.Dialog">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:layout_width">300dp</item>
    <item name="android:scrollX">-10dp</item>
    <item name="android:scrollY">-5dp</item>
</style>

编辑:

我也尝试安卓layout_x 安卓!layout_y ,但没有用

这是一个,我有 ![在此输入图片说明] [1]

This is the one that I have ![enter image description here][1]

但我真正想要的是这仅仅是低于注册标志放置在特定x和y的正!!!!! [在此输入图片说明] [2]

but what I really want is which is just below the signup logo positioned at a particular x and y positive!!!!![enter image description here][2]

推荐答案

这是在code!

LayoutParams lp = this.getWindow().getAttributes();
             lp.x=50;lp.y=20;lp.width=100;lp.height=200;lp.gravity=Gravity.TOP | Gravity.LEFT;
            lp.dimAmount=0;            
            lp.flags=LayoutParams.FLAG_LAYOUT_NO_LIMITS | LayoutParams.FLAG_NOT_TOUCH_MODAL;
this.setContentView(view, lp);

这篇关于当前位置的Acitvity施加一个主题对话在特定的X,Y位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆