这样的效果怎么实现,主要是那个图片一半在里面,一般在外面???
6条回答 默认 最新
- 新根 2016-07-12 09:48关注
实现方式:
最外层透明,然后先shape白色外框,按钮等,最后放美工给定的图片实现叠加效果android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent">//最外层透明色<RelativeLayout //白色圆角外边框 android:id="@+id/gasgauard_notice_contentlayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/gasgauard_notice_top" android:layout_marginTop="-25dp" //确定白色部分与顶部图片叠加的大小 android:background="@drawable/shape_gasguardset_dialog"> <TextView android:id="@+id/gasgauard_notice_content1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginBottom="15dp" android:layout_marginTop="45dp" android:text="确定推送无气警报?" /> <TextView android:id="@+id/gasguardset_content_two" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/gasgauard_notice_content1" android:layout_centerHorizontal="true" android:layout_marginBottom="15dp" android:text="是否将库存不足信息提示相关人员" android:textColor="#999999" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/gasguardset_content_two" android:layout_marginBottom="20dp" android:layout_marginTop="10dp" android:orientation="horizontal" android:paddingLeft="20dp" android:paddingRight="20dp"> <TextView android:id="@+id/gasguardset_notice_sure" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_weight="1" android:background="@drawable/shape_tolerance" android:gravity="center" android:paddingBottom="8dp" android:paddingTop="8dp" android:text="是" android:textColor="@color/white" /> <TextView android:id="@+id/gasguardset_notice_cancle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_weight="1" android:background="@drawable/shape_tolerance" android:gravity="center" android:paddingBottom="8dp" android:paddingTop="8dp" android:text="否" android:textColor="@color/white" /> </LinearLayout> </RelativeLayout> <ImageView //美工给定的图片,这个位置很关键(系统绘画是从最外表画透明,然后画最外表包裹的白色部分,最后将图片叠加在白色内容上面) android:id="@+id/gasgauard_notice_top" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:adjustViewBounds="true" android:src="@drawable/gasguardset_notice2" />
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥20 西门子S7-Graph,S7-300,梯形图
- ¥50 用易语言http 访问不了网页
- ¥50 safari浏览器fetch提交数据后数据丢失问题
- ¥15 matlab不知道怎么改,求解答!!
- ¥15 永磁直线电机的电流环pi调不出来
- ¥15 用stata实现聚类的代码
- ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
- ¥20 docker里部署springboot项目,访问不到扬声器
- ¥15 netty整合springboot之后自动重连失效
- ¥15 悬赏!微信开发者工具报错,求帮改