zoukankan      html  css  js  c++  java
  • 使用android:layout_weight解决布局时把按纽压到屏幕外的问题

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width
    ="fill_parent"
        android:layout_height
    ="fill_parent"
        android:orientation
    ="vertical" >

        <Gallery 
            
    android:id="@+id/gallery"
            android:layout_width
    ="fill_parent"
            android:layout_height
    ="70px"
            
    />
        
        <GridView 
               
    android:id="@+id/gridview"    
               android:layout_width
    ="fill_parent"     
               android:layout_height
    ="fill_parent"   
               android:columnWidth
    ="90px"   
               android:numColumns
    ="auto_fit"    
               android:verticalSpacing
    ="2dp"    
               android:horizontalSpacing
    ="2dp"   
               android:stretchMode
    ="columnWidth"    
               android:gravity
    ="center"
               
               android:layout_below
    ="@id/gallery"
               
    />
        
        <LinearLayout
            
    android:id="@+id/linesexshow"
            android:layout_width
    ="fill_parent"
               android:layout_height
    ="fill_parent"
               android:layout_below
    ="@id/gallery"
               android:orientation
    ="vertical"
               android:visibility
    ="gone"
            
    >
            
            <ImageView 
                
    android:id="@+id/ivsexshow"
                android:layout_width
    ="fill_parent"     
                android:layout_height
    ="0dp" 
                android:layout_centerHorizontal
    ="true"
                android:visibility
    ="gone"
                android:scaleType
    ="fitCenter"
                android:layout_weight
    ="100"
                
    />
            <Button 
                
    android:id="@+id/btnback"
                android:layout_width
    ="fill_parent"
                android:layout_height
    ="wrap_content"
                android:text
    ="@string/btnback"
                android:visibility
    ="gone"
                android:layout_centerHorizontal
    ="true"
                android:layout_weight
    ="1"
                
    />
            
            
        </LinearLayout>
    </RelativeLayout>
  • 相关阅读:
    201621123060《JAVA程序设计》第九周学习总结
    201621123060《JAVA程序设计》第八周学习总结
    网络1712--c语言第二次作业总结
    Linux笔记
    Python-Flask框架之"图书管理系统"项目,附详解源代码及页面效果截图
    CentOS7防火墙firewall
    Linux文件处理三剑客(grep、sed、awk)
    OpenStack、虚拟机以及和当前流行的k8s、Docker四者之间的关系
    反向代理与正向代理的区别
    本地虚拟机在NAT网络连接模式下如何设置才可以访问外网以及使用Xshell远程连接
  • 原文地址:https://www.cnblogs.com/zziss/p/2346230.html
Copyright © 2011-2022 走看看