2016-12-08 13 views
1

デフォルトで表示されるパネルの高さを変更したいと思います。umanoスライディングパネルの可視領域の高さを変更する方法は?

umanoPanelHeightを変更しようとしましたが、それは全く効果がありません。

<com.sothree.slidinguppanel.SlidingUpPanelLayout xmlns:sothree="http://schemas.android.com/apk/lib/com.my.app" 
       android:id="@+id/sliding_layout" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:gravity="bottom" 
       sothree:umanoDragView="@+id/dragView" 
       sothree:umanoOverlay="true" 
       sothree:umanoPanelHeight="68dp" 
       sothree:umanoParalaxOffset="100dp" 
       sothree:umanoShadowHeight="4dp"> 

    <FrameLayout 
       android:id="@+id/container" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
    // Details omitted 
    /> 

    <LinearLayout 
       android:id="@+id/container2" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
    // Details omitted 
    /> 
</com.sothree.slidinguppanel.SlidingUpPanelLayout> 

私は以前この問題に遭遇しましたが、それを解決できませんでした。それは非常に基本的なことに見えますが、私は理解できません。誰かが私を助けることができる?ありがとう!!

答えて

2

私は基本的な統合でサンプルを作成し、それは完璧に動作します。私はそれがあなたが何をしているのかを見分けることができれば幸いです。

また、内部レイアウトを単純なテキストビューに変更して、問題があるかどうかを確認します。

統合

allprojects { 
    repositories { 
     //... 
     mavenCentral() 
    } 
} 


compile 'com.sothree.slidinguppanel:library:3.3.1' 

アプリケーションマニフェスト

<application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:supportsRtl="true" 
     android:theme="@style/AppTheme"> 
     <activity android:name=".MainActivity"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 

スタイル

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> 
     <!-- Customize your theme here. --> 
     <item name="colorPrimary">@color/colorPrimary</item> 
     <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
     <item name="colorAccent">@color/colorAccent</item> 
    </style> 

MainActivity

public class MainActivity extends AppCompatActivity { 
} 

レイアウト

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin"> 

    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:umanoPanelHeight="368dp" 
     sothree:umanoShadowHeight="4dp"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center" 
      android:text="Main Content" 
      android:textSize="16sp" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center|top" 
      android:text="The Awesome Sliding Up Panel" 
      android:textSize="16sp" /> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 

</RelativeLayout> 

Layout1

<?xml version="1.0" encoding="utf-8"?> 
    <com.sothree.slidinguppanel.SlidingUpPanelLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     xmlns:sothree="http://schemas.android.com/apk/res-auto" 
     android:id="@+id/sliding_layout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:gravity="bottom" 
     sothree:umanoPanelHeight="368dp" 
     sothree:umanoShadowHeight="4dp"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center" 
      android:text="Main Content" 
      android:textSize="16sp" /> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:gravity="center|top" 
      android:text="The Awesome Sliding Up Panel" 
      android:textSize="16sp" /> 
    </com.sothree.slidinguppanel.SlidingUpPanelLayout> 

は両方のレイアウトとlayout1が正常に動作していると私は代わり368dp使用されるパネルのサイズを増加させること見ることができますデフォルト値である68dpのAndroid 6.0でテスト済みです。

+0

コードメイトのおかげで何が間違っているのか分かりませんが – varunkr

関連する問題