2012-05-29 41 views
0

我正在处理应用程序,它从图库中加载照片(照片取自设备相机),并执行其他应用程序相关功能并保存,我面临的问题是图像该负载垂直和水平方向压缩会使图像缩小,我使用下面的代码为xml文件不要求FrameLayout图像缩小

<?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:gravity="bottom" 
    android:orientation="vertical" > 

    <FrameLayout 
     android:id="@+id/frame" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/previous_btn" 
     android:layout_weight="0.88" > 

     <ImageView 
      android:id="@+id/imageView" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" 
      android:scaleType="matrix" /> 
    </FrameLayout> 

    <Button 
     android:id="@+id/previous_btn" 
     android:layout_width="100dip" 
     android:layout_height="wrap_content" 
     android:text="Previous" /> 

    <Button 
     android:id="@+id/next_btn" 
     android:layout_width="100dip" 
     android:layout_height="wrap_content" 
     android:layout_toRightOf="@+id/previous_btn" 
     android:text="Next" /> 

    <Button 
     android:id="@+id/button" 
     android:layout_width="100dp" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center" 
     android:layout_toRightOf="@+id/next_btn" 
     android:text="Save Picture" /> 

</RelativeLayout> 

请帮我解决这个问题! 此致敬礼

回答

1

那么你的FrameLayout被设置为wrap_content的高度,并且ImageView被设置为match_parent的高度。所以这有点矛盾。哈哈。而且我不确定你如何在相对布局中使用权重。除非这是您使用LinearLayout时剩下的部分。而你的previous_btn在relativelayout集中没有位置。