2015-01-31 17 views
0

제목과 날짜가있는 활동처럼 뉴스를 만들고 싶습니다. 처음에는 상단의 공유 및 즐겨 찾기 버튼, 기사 텍스트 (그리고 어쩌면 일부 이미지와 헤더 제목)은 html로 서버에서 가져오고, 마지막에는 관련 뉴스 목록을 제공합니다!안드로이드에서 webview를위한 머리말과 꼬리말을 만드는 가장 좋은 방법

기사 HTML에는 WebView를 사용해야하지만 헤더와 메인 웹 뷰가 함께 스크롤해야하므로 스크롤 옵션 인 ScrollView에서이를 사용해야 할 수 있습니다.

나는이 빨간색했다 : webview in scrollviewDisable scrolling in webview

하지만 내가 2015 년이를 구현하는 가장 좋은 방법이 무엇인지 알고 싶어요! 안드로이드 4.01 + 함께 작동 할 수 있습니다

답변

1

글쎄, 가장 좋은 방법은 아직 scrollView에 넣어하는 것입니다!

그것은 내 삼성 안드로이드 4.4에서 작동하지만 나머지는 알지 못합니다!

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <RelativeLayout 
     android:id="@+id/news_activity_title_lay" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     //Some Widgets Here for header 

    </RelativeLayout> 

    <WebView 
     android:layout_below="@+id/news_activity_title_lay" 
     android:id="@+id/news_activity_web_view" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@color/white"> 

    </WebView> 

    <LinearLayout 
     android:id="@+id/news_activity_related_base_lay" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" 
     android:layout_below="@+id/news_activity_web_view"> 

     //Some Widgets Here foe footer 

    </LinearLayout> 

</RelativeLayout> 

재미있는 것은, 비록 안드로이드 스튜디오 내가 이렇게하지 말라는입니다! :/

+0

매력처럼 작동합니다 (Android 6). –