android:filterTouchesWhenObscured

本文详细解析了PackageInstaller中install_confirm.xml文件的布局设计。重点介绍了确认界面中的按钮布局及属性设置,包括取消和确定按钮的位置安排与触摸过滤属性的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In Package installer activity.

In PackageInstaller/res/layout/install_confirm.xml

98    <!-- OK confirm and cancel buttons.  -->
99    <LinearLayout
100            android:layout_width="match_parent"
101            android:layout_height="wrap_content"
102            android:orientation="vertical"
103            android:divider="?android:attr/dividerHorizontal"
104            android:showDividers="beginning">
105
106        <LinearLayout
107                style="?android:attr/buttonBarStyle"
108                android:layout_width="match_parent"
109                android:layout_height="wrap_content"
110                android:orientation="horizontal"
111                android:measureWithLargestChild="true">
112
113            <LinearLayout android:id="@+id/leftSpacer"
114                    android:layout_weight="0.25"
115                    android:layout_width="0dip"
116                    android:layout_height="wrap_content"
117                    android:orientation="horizontal"
118                    android:visibility="gone" />
119
120            <Button android:id="@+id/cancel_button"
121                    android:layout_width="0dip"
122                    android:layout_height="wrap_content"
123                    android:layout_gravity="start"
124                    android:layout_weight="1"
125                    android:text="@string/cancel"
126                    android:maxLines="2"
127                    style="?android:attr/buttonBarButtonStyle" />
128
129            <Button android:id="@+id/ok_button"
130                    android:layout_width="0dip"
131                    android:layout_height="wrap_content"
132                    android:layout_gravity="end"
133                    android:layout_weight="1"
134                    android:text="@string/next"
135                    android:maxLines="2"
136                    android:filterTouchesWhenObscured="true"
137                    style="?android:attr/buttonBarButtonStyle" />
138
139            <LinearLayout android:id="@+id/rightSpacer"
140                    android:layout_width="0dip"
141                    android:layout_weight="0.25"
142                    android:layout_height="wrap_content"
143                    android:orientation="horizontal"
144                    android:visibility="gone" />
145
146        </LinearLayout>
147    </LinearLayout>

filterTouchesWhenObscured attribute mean the button's onClick will not work if there is another view on the top of this button even if the above view is transparent.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值