加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

xml designe 在底部放置一个Button

发布时间:2020-12-16 06:08:45 所属栏目:百科 来源:网络整理
导读:/prepre name="code" class="html"关键是:使用 RelativeLayout 布局,然后在 Button 里面android:layout_alignParentBottom= "true" 代码如下: !-- 在底部放置一个Button -- RelativeLayout android:layout_width="match_parent" android:layout_height="w
</pre><pre name="code" class="html">关键是:使用 RelativeLayout 布局,然后在 Button 里面android:layout_alignParentBottom= "true" 
代码如下:
   <!-- 在底部放置一个Button -->
         <RelativeLayout
			    android:layout_width="match_parent"      
			    android:layout_height="wrap_content"
			    android:layout_margin="6dp"
			    android:orientation = "vertical"
			    android:layout_weight="1" 
			    android:layout_marginTop="10dp">
               <Button
                   android:id="@+id/button_login"
                   android:layout_width="fill_parent"
                   android:layout_height="40dp"
                   android:drawableRight="@drawable/next"
                   android:maxLength="7"
                   android:paddingRight="5dp"     //内部内容与 边框距离
                   android:layout_margin="5dip"   //本边框 与外部的距离
                   android:text="@string/next"
                   android:textColor="@color/white"
                   android:layout_alignParentBottom= "true"          //关键:与父layout 底部对其
                   android:background="@drawable/button_selector2"
                   android:textSize="20sp" />
       </RelativeLayout>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读